1. RE: Wishlist
- Posted by kbochert at ix.netcom.com Jun 27, 2001
- 441 views
-------Phoenix-Boundary-07081998- Irv Mullins wrote: >>3-- Pass-by-reference: >> integer x >> foo (&x) -- x may be changed >Useful, but the wrong syntax, in my opinion. >Perhaps better would be to use: >procedure foo (integer x) >.... blah... >=A0=A0=A0=A0x +=3D1 >then call it like this: foo (varying x) It would suit me. >However, this has been requested before, and Rob has not shown >much interest it implementing it, which leads me to believe that >something about the internal workings of Euphoria would make >that operation either difficult, or wasteful of time or memory. >>5-- Enhanced standard library(s), possibly built-in >It would just be a matter of organizing them a bit, documenting >and stamping them all. Maybe Rob doesn't have time for all that. >All volunteers take one step backward. Very difficult to do in the democratic volunteer environment. Really needs a dictator (Rob) >>6-- slicing shorthands: >Also frequently suggested. Your version adds a possible >syntax checking problem, in that seq[2..] could *easily* be a typo - you just >forgot to finish the range. In my mind, 'seq[2..]' could be a typo in the same sense that 'x +=3D 1' could easily be a typo (it was supposed to be 10!) I think '..' is prettier than '~', but either is acceptable. >And as Carl pointed out, there is a definite problem with the >seq +=3D "a", a notation that confuses me anyway. It looks >like a math function, maybe you want to add the ascii value of >"a" to each atom in the sequence=3F 'append' may be wordy, >but at least its meaning is clear. The wordiness I was trying to address was not the 'append', but the redundant 'seq'. My way is a failure; Is there another way=3F >>7-- File-local definitions should override globals >Breaks too much code, .. =3F=3F I don't understand. Isn't it true that file-local definitions which match globals draw error messages now=3F The specific case I'm thinking of is: include mylib.e -- defines 'global type boolean ...' include file.e -- ERROR -- boolean already defined The standard Euphoria library file 'file.e' locally defines a 'type boolean ...' This forces the global version to be included after file.e. This is a minor include file ordering problem in this case, but could get much worse as libraries proliferate. >>13- def >>replaces function or procedure >Don't like this. There are very good reasons for having functions and >procedures as entirely separate beasts. def is not definitive enough for >me. Ok. That wish came directly from my 'lazy-typist' department. >>14- structures >Apparently un-doable with Euphoria as it stands. >As far as I have been able to determine, there's no way to retain >the type of a member of a sequence. So type checking items >within a sequence wouldn't be possible. If I cant have types, I still want names. >>15- Block comments >Example: >pretext disclaimer =3D >This program is copyright 2001 by Irv Mullins <ir- at ellijay.com> >who bears no responsibility for its use. If your hair falls out, your >cat gets pregnant, or your kids get poison ivy, it's not my fault. >=A0=A0=A0So there! >end pretext good idea, but see new wish # 18 below >>17- Automatic 'Result' >I'm not sure I understand the advantage this has over simply >putting 'return 3.14' as the final line in the function. Please elaborate. This is another minor 'lazy-typist' wish. I was noticing the large number of functions I write that start off: function foo () integer Result Result =3D 0 ... and thinking how nice it would be if the common 'Result' were built-in. Pretty minor! 18- Concatenated strings Euphoria should merge successive strings, including across lines. sequence s s =3D "this is" " a single string" s=3D "this is also" " a single string!" P.S. My 'GOO' translator implements a number of these wishes, including namespaces, slicing shorthands, and initializers. (Beware: its dot-notation objects only work in the simplest cases.) Regards Karl Bochert -------Phoenix-Boundary-07081998---
2. RE: Wishlist
- Posted by Tony Bucholtz <tony_bucholtz at hotmail.com> Jun 27, 2001
- 435 views
G'day all david at aldred.demon.co.uk wrote: > <snip> > And from even further back in my programming history, but something I've > missed since using Algol - > > for i = {1,4,5.6,e/2, sin(theta)} do > (something with i) > next Good idea. A couple of "improvements": Allow ranges in the list, eg for i = {1..4, 5.6, e/2, 39..199} Allow "mixed mode", eg sequence seq1, seq2 seq1 = {1,4,10} seq2 = {e/2,sin(theta),87} for i = {seq1,21..39,seq2,101,103} Change "for" to something like "foreach", a visual clue that we're doing some "list processing" rather than a conventional loop. Yes, I know, another reserved word, more chances to break existing code... Just my $0.02 Regards Tony
3. RE: Wishlist
- Posted by Tony Bucholtz <tony_bucholtz at hotmail.com> Jun 27, 2001
- 407 views
G'day all Irv Mullins wrote: > On Wednesday 27 June 2001 17:50, david at aldred.demon.co.uk wrote: > > > > And from even further back in my programming history, but something I've > > missed since using Algol - > > > > for i = {1,4,5.6,e/2, sin(theta)} do > > (something with i) > > next > > > > which then does the loop for the values in the sequence, one at a time. > > If I recall correctly, that would be impossible with Euphoria, which > makes > a copy of the loop variables before beginning, so any change would be > disregarded. Let's see: > > atom x, y > > x = 1 > y = 10 > for i = x to y do > x -=1 > ? i > end for > > Yep, counts from 1 to 10. > > Regards, > Irv > I don't think anyone wants to change the value of the loop variable *inside* the loop. The suggestion is for another way to set the value of the loop variable *prior* to its use inside the loop. Ferinstance, if I wanted to process only certain elements of a sequence, I'd have to use something like: sequence seqindex seqindex = {3, 5, 10, 21, 22, 40, 45, 50, 63} for i = 1 to length(seqindex) seq2process[seqindex[i]] = <something> end for The suggestion is for an easier way to do this sort of work, eg: foreach i = {3, 5, 10, 21, 22, 40, 45, 50 ,63} seq2process[i] = <something> ? i end foreach would result in: 3 5 10 21 <etc> Besides, any idea for minimizing [..[]] and [][] and suchlike syntax for sequences can't be all bad ;) Regards Tony
4. RE: Wishlist
- Posted by Kat <gertie at PELL.NET> Jun 28, 2001
- 427 views
On 28 Jun 2001, at 5:34, Tony Bucholtz wrote: > > I don't think anyone wants to change the value of the loop variable > *inside* the loop. Let me raise my paws higher then! While i haven't wanted to recently, having control of the loop var can be useful. Ferinstance, if you wanted to start over on a condition, or you have a huge list to process in the loop and want to skip one item conditionally on a *previous* state, or collection of states. Yes, it can be done other ways, but like a "goto", things can sometimes be done easier a different way. Kat