Re: [q-lang-users] Polynomial module.
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2006-11-02 23:27:55
|
Rob Hubbard wrote: > I would like to use inline "var"s. Unfortunately, that might then hide > another undeclared symbol elsewhere in my script. Right. :( Those inline var's should really be confined to the lexical scope of a single definition. Why haven't I thought about this before?? > var Y in > sieve {X|Xs} = {X|sieve {Y:Y in Xs,Y mod X<>0}}; Not a bad idea. Another possible approach would be to attach an inline var to an expression, as in: sieve {X|Xs} = {X|var Y : sieve {Y:Y in Xs,Y mod X<>0}}; The scope of the var declaration would then be limited to the expression after the ':'. Eddie's example could then be written as: outliers X = filter (var X : \X . (X < LF) or (X > RF)) X ...; That would be much more useful than the inline var declarations we have now. Opinions? Anyone against this change? 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 |