From: Eddie R. <er...@bm...> - 2008-08-14 21:41:18
|
On Thu, 2008-08-14 at 22:59 +0200, Albert Graef wrote: > it's worth the effort, because it sucks having to write > (1,2):(3,4):...:[] all the time. +1 > - I'd also like to revise the syntax of 'using' so that the module names > are separated by commas, which is more in line with the 'extern' > declaration syntax which also uses the comma delimiter. (I'd still like > to keep the syntax of operator and 'nullary' declarations, though, > because there whitespace as a delimiter is much easier to read when > listing non-alphanumeric symbols, IMHO.) OK by me. > - The discussion I had with Libor about how to implement a sequencing > operator ("first x, then y") also kept me thinking, because the solution > I proposed there is not tail-recursive. To do this in a proper way, we'd > need a built-in sequencing operator (special form). While it's not > strictly needed, it's much more convenient than having to write 'y when > _ = x end' all the time. > That sequencing operator should be easy to implement, but how should it > be named? We can't use Q's '||' because that's logical or in Pure, and > we can't use C's ',' because that's Pure's tupling operator. Another > obvious choice would be the Haskell'ish monadic sequencing operator '>>' > but that's currently used for bit shifts (maybe I could rename '<<'/'>>' > to shl/shr, though). Any other ideas? I've been using $$ or |> but whatever you decide is fine by me. One minor quibble. Could we use ++ for list and string concatenation? It interferes with using + for adding matrices when they are implemented as lists of lists. > Finally (this is not a syntax change, but it also breaks backward > compatibility), I'd like to revise the script search. Currently the > interpreter always searches the current directory and then the PURELIB > directory. In the case that the interpreter is run with a main script > (pure -x main.pure), I think it makes sense to search the directory of > the main script instead of the cwd (for scripts loaded with a 'using' > clause). That would make it possible to install the main script along > with any other non-library modules it needs into its own directory and > run it from there. This would be useful, in particular, for "shebang" > scripts. +1 Does TIA mean "The Intellectual Activist?" ;-) e.r. |