Re: [q-lang-users] where
Brought to you by:
agraef
From: Tim H. <q...@st...> - 2006-10-10 10:53:18
|
"Rob Hubbard" <hub...@gm...> writes: > If you wish to use "let" syntax, then the "let" clause could end in > "in" rather than a semi-colon: Absolutely! It's one of the few ML-isms I still bother remembering - I always read `let' as `let blah... in' in scheme and haskell. > let N = #S - 1 in > strip C S = strip C $ sub S 0 (N-1) if (S!N = C); > > that would prevent it looking like a separate definition. > > Further definitions sharing the let clause could be separated by > something like "and also" (as opposed to "and" or "and then"). I can't > see a way to provide elegant, "Q-ish" nesting without a terminating > delimiter for a let clause though. This: > > let T2 = 2*T in > let S = T2+1 in > f T = sin S > //"end let" > and also > let P = T2-1 in > g T = cos P; > //"end let" > //"end let" > > would still be ambiguous: which "let" does the "and also" match? An > "end let" would just produce blocks, which Albert has already > indicated would not be in keeping with Q. It's a problem. OK, I've only half been following this, but is there some potential for using tuples/braces to delimit such a list of local-scope assignments? If need be, how about some kind of (= , , , ...) form for constructing a scope? It's a bit Scheme of me, but hey :) ~Tim -- <http://spodzone.org.uk/> |