: now terminates on (
; creates a new list in addition to terminating all previous : and ;
(before, it only terminated and didn't create a new list)
; now terminates ; in addition to :
I've actually changed my mind so that I don't mind using parens, but only for function calls. Calls to a vau (def, if, and, let, etc.) shouldn't be wrapped in parens:
mac accessor -> n v
uniqs %a
{def n -> %a
{{%a v} %a}}
def or: casevau env
x -> (eval x)
x @r -> let x (eval x)
if x x (eval {or @r})
The above is a hypothetical mockup for new syntax for Nulan. It's radically different than the current syntax, but I think it looks very clean. At least, compared to the current syntax:
$mac accessor; N V ->
$uniqs %A
[$def N; %A ->
[[%A V] %A]]
$defvau $or Env
X -> eval X
X @R -> $let X: eval X
$if X X: eval [$or @R]
Oh, I see what you're saying. You're saying ";" should have different meaning depending on whether it's to the left or the right of the symbol. That could work, but I feel it's making whitespace a bit too significant. No way to know for sure without trying it out, though.
well, you already make whitespace significant by saying that alphabeta is not alpha beta
the real crux of the issue is whether it comes before an identifier or after
don't think of it as whitespace disambiguating
nobody says *pointer in C is "too significant whitespace" just because it can't be separated by a space (in which case it becomes multiply!)
Like I said, I think it's only a bit too far, so if somebody wants to run with that idea, go for it. I personally favor the idea of having multiple syntaxes that parse to the same AST.
I didn't know you couldn't have a space after deref!
But, I dunno.. attaching ';' to identifiers is different from attaching '*'. Our brains are trained to treat the semi-colon as punctuation, never part of a word. Even programming languages have only reinforced this pattern. It's going to be a hard habit to break.
"Our brains are trained to treat the semi-colon as punctuation, never part of a word. Even programming languages have only reinforced this pattern. It's going to be a hard habit to break."
I would personally use something like | if it's not used for anything
it looks like an undirected paren so in cases like a |b| c it translates to a ((b) c) or (a (b)) c
I guess I'd pick the first option (more natural for reading left to right), but for the order of operations it doesn't matter
I agree that this is probably too much. Modern languages are training us to ignore the semi-colons; to have to pay attention to the whitespace around them seems retrogressive.
To be fair, the semicolons in Nulan are mostly used as infix operators, unlike in languages like C where they're required at the end of every statement. And Nulan already uses significant whitespace indentation. So I don't think it'd be a lot worse to make the whitespace significant for ":" or ";" I just think it might be a bit too far.