Re: [pure-lang-users] Parsing Question
Status: Beta
Brought to you by:
agraef
|
From: Albert G. <Dr....@t-...> - 2008-05-01 18:39:18
|
Libor Spacek wrote: > Why are "commands" not terminated by semicolons as well? Because they are special. Everything that's listed under "INTERACTIVE USAGE" in the manpage does *not* belong to the Pure language at all, and is parsed and processed in a *very* different way (more like shell command lines). > stats on; > stats: invalid parameter 'on;' (must be 'on' or 'off') > > Is this inconsistency intended? Yes. Those commands *are* special, they have nothing in common with Pure expression syntax, and that should be very clear. What I *could* do is require a special escape character, like the '!' in front of shell escapes. So you'd type something like: :stats on instead of just: stats on That would be an easy change in the parser. Personally, I think that this would be rather inconvenient. But I'll consider to do that change if a big majority prefers it that way. So let's have a poll. :) [ ] Yes, escape character please! :stats on [ ] No, keep it like it is! stats off > I have to remember which commands I defined and which were predefined and, > in each case, use or not use a semicolon. You *don't* define any commands. What you define are Pure functions and variables, and this is all done in the Pure syntax. The special commands are fixed and hard-wired, there's no way you can define new ones. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |