Re: [q-lang-users] where
Brought to you by:
agraef
From: Eddie R. <ed...@bm...> - 2006-10-10 14:22:58
|
Albert, Rob, Tim: Ok! No Dr. or Mr. ;) Understood. I really didn't mean to open a can of worms ;) This is somewhat related to the topic at hand. I've seen Fortran's "common," Algol's (scheme, pascal, ada, etc...) block structure, lisp's dynamic scoping, and global variables. Is there another method of sharing variables? Someone will probably mention OOP, but I just see it as an extension of block structure to include functions or procedures. I'm not intending any one of these as a solution to problem below, I'm just curious. Eddie > foo X = ... Y ... where ... if ..., > = ... Y ..., > where Y = ...; > But that's awkward to parse, since the entire collection of > equations > must be in memory before you can start generating code. ------------------- > 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. ------------------- > If need be, how about some kind of (= , , , ...) form for > constructing a > scope? > It's a bit Scheme of me, but hey :) |