[clean-list] Wish list, part 3

Matt Lye mlye@idirect.ca
Fri, 12 Apr 2002 14:41:14 -0400


From: Marco Kesseler <m.wittebrood@mailbox.kun.nl>
> >There's only one language family I use regularly where "all symbols are
> >separated by whitespace (and brackets)", and that's Lisp.  Lisp can get
> >away with it because it has *no* infix operators.  x+y might as well be
> >a symbol because there isn't anything else it could be.
>
> By the way, I do think that it makes sense to forbid something as
> 'x+y' as an identifier. The syntax that Matt Lye proposed (FunnyChar
> [AnyChar] FunnyChar) seems quite usable, but I do not know whether it
> is feasible. Zero or more FunnyChars at either end may be even more
> usable, and not less feasible.

Doctor Plasmejer was kind enough to (gently) point out one of the problems
my proposed syntax would encounter, so I'm forwarding my revision.  It's
more than likely that there are further problems of which I am blissfully
unaware.

BTW, I had meant 'AnyChar' to include both 'FunnyChar' and alphanumerical
characters.
To clarify, the below would allow both x<*>y and x <exclusive&&operator> y,
but not x<exclusive&&operator>y.

>From: Rinus Plasmeijer <rinus@cs.kun.nl>
>To: Matt Lye <mlye@idirect.ca>
>
> Hi Matt,
>
> > This would allow expressions such as +symbol+, *symbol*, ?symbol?,
> > @node>, <elem>, without creating confusion such as in the n+1 instance.
>
> Don't think so. How about  n+m+k? Is it n +m+ k (where +m+ is a symbol) or
> n + m + k?
>

I had a half-formed reason in the back of my head involving pattern matching
for why I thought that was ok*, but I guess even if it was, it would mean
trouble for anyone who later created or inadvertently imported +m+ as an
operator and then tried to figure out why let m = 2 in 1+m+(m^2) was a type
error instead of seven.

At any rate, maybe an operator syntax of [FunnyChar] | Whitespace FunnyChar
[AnyChar] FunnyChar Whitespace (as you used above) might keep the idea
floatable, allowing n+m+k to not equal n +m+ k and n + 1 to equal n+1.

matt.

*(this is why I never joined the military.  "Sir!  I had a half-formed
reason, sir!".)