I've been playing around with Cat a little bit recently, and I have a
few comments, but I'll just start out with just this one question.
In your grammar, you have the following rules:
identifer ::==
alphanum+ |
group_symbol* |
single_symbol |
group_symbol ::==
[~,#,$,%,^,&,*,-,+,=,|,\,:,;,<,>,.,?,/]
alphanum ::==
letter |
number
I'm wondering if there is any reason that 'alphanum' and
'group_symbol' are kept separate in the identifier. I would think
since, by the nature of stack languages, there are no infix symbols,
there would be no need to keep these separate. Take, for example
Scheme, which also has no infixes; in Scheme you can name things "my
+function" or "|->i*i<-|", or a non-contrived example, "call-with-
current-continuation". Is there any reason for not allowing this is
Cat?
As an example, say somebody would someday want to write an html
library, they could do something like:
define <p> { "<p>" }
define </p> { cat_str "</p>" cat_str }
So the following code:
<p> "This is in my paragraph" </p>
Yields:
"<p>This is in my paragraph</p>"
I think it gives just a little bit more freedom in name identifiers.
Just curious,
Bryan Burgers
I will spend a couple of days mulling it over, but will probably add
the feature in the release after next.
Thanks for the suggestion!
Christopher Diggins