We'll soon be merging code adding a new enumerated type to ASH (and JavaScript!). A few functions will become redundant (path_name_to_id, path_id_to_name and my_path_id) and you'll see warnings in your GCLI when running code that uses them.
I'd like to merge this in around 11 hours (9pm in the UK) as ASH is unaffected and major JavaScript library maintainers have been notified. Please let me know if you have any good reason I should delay that merge.
ASH
ASH code should be unaffected - our script parser can handle coercion between path names and path objects. This means that when the parser sees
it will notice the type mismatch and quietly turn that into
Hooray!
JavaScript
In JavaScript things are much the same... except one thing. You may have wondered "what is the difference between == and === in JavaScript?" Well this is a great example of the difference. == allows coercion like ASH does. === does not allow it. That means the following will soon be the case in JavaScript:
I'd like to merge this in around 11 hours (9pm in the UK) as ASH is unaffected and major JavaScript library maintainers have been notified. Please let me know if you have any good reason I should delay that merge.
ASH
ASH code should be unaffected - our script parser can handle coercion between path names and path objects. This means that when the parser sees
Code:
if (my_path() == "Trendy") {
it will notice the type mismatch and quietly turn that into
Code:
if (my_path() == to_path("Trendy")) {
Hooray!
JavaScript
In JavaScript things are much the same... except one thing. You may have wondered "what is the difference between == and === in JavaScript?" Well this is a great example of the difference. == allows coercion like ASH does. === does not allow it. That means the following will soon be the case in JavaScript:
Code:
myPath() == "Trendy"; // returns: true
myPath() === "Trendy"; // returns: false
myPath() === Path.get("Trendy"); // returns: true