in general if I indent and do x = 1
, doesn't that always begin a def?
That was one of the things that changed with the introduction of "blocks/statements" a while back
Prior to that, it worked _inconsistently_
That's something we can bring back in the future, but I'd want to figure out some of the oddities with that first
e.g. I'm having a hard time understanding why someone would ever want to do:
x +
y = 1
y*2
I would have to go back in the git history and check - but I _think_ that was one of the cases that never worked
I forget whether that worked in the context of an argument to a function
(this probably deserves a separate thread...)
8 messages were moved here from #compiler development > Weird fuzzing bug of the day by Joshua Warner.
Joshua Warner said:
e.g. I'm having a hard time understanding why someone would ever want to do:
x + y = 1 y*2
that's a very fair point!
From a parsing perspective, I think the biggest question in bringing this back would be how this interacts with arguments in an apply. Can you _only_ do this on the last argument in an apply? How would you separate more arguments to the outer apply, from arguments to the last expr of the defs sequence?
I guess the real critical thing is that defs work inside function bodies, constants, expect
s, and if
and where
branches
everything else feels non-essential
and more of an "ease of teaching how it works" thing
but seems fine overall to not support it imo
ease of teaching how it works
Yeah, that's a fair point
like we could always consider adding support for it someday if we think it's worth it
but for right now I would rather prioritize correctness
of the compiler
Last updated: Jul 06 2025 at 12:14 UTC