« first day (3697 days earlier)      last day (83 days later) » 

2:26 AM
@rgchris It may also interest you to compare with JavaScript undefined. If you say typeof asfasdfasdfasdf and it's never been assigned, it will respond with "undefined"...but attempts to access it will trigger errors. However, if you assign a variable with undefined, it also says the type is undefined...but it does not error.
(They also consider undefined to be conditionally false, which I think is a bad choice...erroring is better. They also report typeof NULL as an "object", which is universally agreed on as a bad choice that should have been NULL instead.)
 
2:53 AM
@johnk Yup, these things aren't somehow universally obvious choices.
 
 
13 hours later…
3:48 PM
@HostileForksaysdonttrustSE It's not so much the behaviour as the prevalence. I know it's an extreme example, but why would you look up asfasdfasdfasdf other than it being a typo? Are typos enough of a reason for this type of handling? If you're checking to see if a word is set, then there are ways to do that without evaluating it. I'm not disputing anything here, just trying to articulate one of those things I take for granted
I guess another way of asking is: are typos the only reason we have special handling when evaluating unset words?
 
 
5 hours later…
8:49 PM
@rgchris I like erroring when you use something before assignment, even if you know it to be declared. Perhaps not everyone thinks it necessary. e.g. JavaScript: function foo() { let x; if (x) {console.log("no error in javascript")} }
With any "auto-gathering" it seems more necessary, because it crosses into the typo area.
But typos are certainly the non-negotiable reason.
If they did nothing, and you type apend block 7, the APEND would be unset but quiet, the block would be inert, the 7 would be inert, the expression would do nothing.
 
9:35 PM
But that points out an important distinction from JavaScript... function calls do error if the function is not defined, as there'd be no other meaning for x()
Since we do not (typically) distinguish function calls and variable references, you don't have that safety net, which would let type checking catch at least some issues. So even if you do assign a BAD-WORD! result (like from a function whose return value you misunderstood), then usage afterward causing an error is good.
 
10:35 PM
Five weeks lockdown 25 minutes from now.
 
 
1 hour later…
11:59 PM
posted on December 14, 2020 by hostilefork

One might think it obvious that an ordinary function that quotes its first argument needs to "win" when it quotes right... even if an enfix function after it quotes left. Because you want help -> to give you the help for ->, and not try to construct a function with the named parameter help (and then fail, due to having no body). It's not quite that simple. To cut to the co

 

« first day (3697 days earlier)      last day (83 days later) »