1. Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 26, 2001
- 653 views
Here are a couple of other things which might be considered: New keywords 1. version usage: version 1.03 -- does nothing, acts just like a comment, in THIS file. 2. requires usage: include graphics.e requires 1.03 -- issues a warning if file being included is NOT version 1.03 -- if graphics.e has no version xxx line, then this is ignored. Advantages: Will help people get packages to run. If the setup isn't the same as the author had used for testing, they will know immediately what the problem is and what they need to do to fix it. Disadvantages: None - won't break any existing code. Regards, Irv
2. Re: Wishlist
- Posted by daryl_vdb at HOTMAIL.COM Jun 26, 2001
- 579 views
>Disadvantages: > None - won't break any existing code. except if the existing code has a variable, constant, function or procedure named "version" or "requires".
3. Wishlist
- Posted by kbochert at ix.netcom.com Jun 27, 2001
- 571 views
-------Phoenix-Boundary-07081998- MY WISHLIST: 1-- Variable initialization: integer x =3D 5 ... function foo () sequence s =3D "" ... 2-- continue statement: goes to start of for or while loop 3-- Pass-by-reference: procedure foo (reference p1) ... integer x foo (&x) -- x may be changed 4-- Enhanced '=3F' If a sequence contains all ascii characters, output it as string. 5-- Enhanced standard library(s), possibly built-in string functions regular expressions isAscii () etc. containers 6-- slicing shorthands: seq[2..] =3D> seq[2..length(seq)] seq[i..-3] =3D> seq[i..length(seq-3)] seq =3D [2..] =3D> seq =3D seq[2..length(seq)] seq +=3D "a" =3D> seq =3D append (seq, "a") 7-- File-local definitions should override globals 8-- Common utilities: boolean FALSE TRUE STDERR STDIN STDOUT 9-- function indexing s =3D command_line()[2] 10- Namespaces include get.e as G x =3D G:get () 11- pathlists command line and/or .cfg file gives search paths for include files like: ".;c:\mylibs" SO that executing 'exw prog args' would cause Euphoria to check 'prog.cfg' for pssible include paths. 12- flags command line and/or .cfg file gives flags exw test warn=3D3 -- run and set 'warn' to 3 test.cfg: warn =3D 6 -- default 'warn' srcpth =3D ".;c:\temp" ... 13- def replaces function or procedure 14- structures a sequence with named and typed indexes. struct X { integer a, sequence b } struct X a =3D> sequence a a =3D {0,""} a.b =3D "=3F" =3D> a[2] =3D "=3F" s =3D append(s, X) =3D> s=3D append(s,{0,""}) 15- Block comments 16- Exceptions throw () causes returns until caught much like Java 'unchecked' exceptions. function x () throw (type, arg) ... function y () ... return 0 catch (type) ... end 17- Automatic 'Result' Have each function automatically declare the object 'Result' which is returned by default. (Much like Eiffel). Then the following is legal function pi () Result =3D 3.14 end function Karl Bochert -------Phoenix-Boundary-07081998---
4. Re: Wishlist
- Posted by euphoria at carlw.legend.uk.com Jun 27, 2001
- 607 views
kbochert wrote: > 6-- slicing shorthands: > seq[2..] => seq[2..length(seq)] > seq[i..-3] => seq[i..length(seq-3)] > seq = [2..] => seq = seq[2..length(seq)] > seq += "a" => seq = append (seq, "a") What would you do in the case: seq += 'a' ...since this currently adds 'a' (97) to all elements of seq, and would break exisiting code if it was changed... Carl - Being picky. Sorry.
5. Re: Wishlist
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 27, 2001
- 563 views
----- Original Message ----- From: <kbochert at ix.netcom.com> To: "EUforum" <EUforum at topica.com> Subject: Wishlist > MY WISHLIST: [big snip] Wow! At first glance, this is almost identical to my wishlist. I wonder if we are both mad? ------ Derek Parnell Melbourne, Australia "To finish a job quickly, go slower."
6. Re: Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 27, 2001
- 552 views
On Wednesday 27 June 2001 00:49, daryl_vdb at HOTMAIL.COM wrote: > >Disadvantages: > > None - won't break any existing code. > > except if the existing code has a variable, constant, function or procedure > named "version" or "requires". True enough - but the same thing could be said of *any* new keyword. Maybe I would like to create a variable named "cursor" in my program. I can't, it's already taken. Same with 'value', 'where', etc. If we don't want any new keywords, then Rob can stop work on 2.3, and save himself a lot of trouble, because there's not much he can add. Of course, proper namespacing could make that a moot point, as these two words could exist outside of user namespace. Regards, Irv
7. Re: Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 27, 2001
- 553 views
On Monday 25 June 2001 13:37, kbochert at ix.netcom.com wrote: > MY WISHLIST: > > 1-- Variable initialization: > integer x = 5 > ... > function foo () > sequence s = "" > ... Yes, no doubt about it. I continually get messages such as: test.exu:3780 variable s has not been assigned a value --> see ex.err because I declared, but forgot to initialize, s. Were it possible to do this on the same line as the declaration, I might just remember. Also, it makes code clearer. > 2-- continue statement: > goes to start of for or while loop There are instances where this can simplify code, which otherwise would require deeper if... then nesting. A qualified yes from me. > 3-- Pass-by-reference: > procedure foo (reference p1) > ... > integer x > foo (&x) -- x may be changed Useful, but the wrong syntax, in my opinion. You have lost the type of p1, so it is in effect always treated as an object. No more automatic type checking. Perhaps better would be to use: procedure foo (integer x) .... blah... x +=1 then call it like this: foo (varying x) -- I know, it sounds too much like COBOL.:{ There's too much chance of forgetting the &, or including it accidentally, and having "unexpected results". Plus its meaning is not immediately obvious, and worst of all , it looks like C! 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. (in other words, not a good tradeoff) > 4-- Enhanced '?' > If a sequence contains all ascii characters, output it as string. Amen. And use the same function in the debugger. > 5-- Enhanced standard library(s), possibly built-in > string functions > regular expressions > isAscii () etc. > containers Yep. These things already exist, thanks to all the contributors. 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. > 6-- slicing shorthands: > seq[2..] => seq[2..length(seq)] > seq[i..-3] => seq[i..length(seq-3)] > seq = [2..] => seq = seq[2..length(seq)] > seq += "a" => seq = append (seq, "a") 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. Therefore, I suggest using a character that isn't used for anything else - the tilde - to indicate "to end" or "from beginning", as in seq[2~] or seq[~14} -- seq[~] would be an error. Means the same to me, but it's really hard to confuse the tilde with two dots, or to type a tilde when you meant to type ..4. And as Carl pointed out, there is a definite problem with the seq += "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? 'append' may be wordy, but at least its meaning is clear. > 7-- File-local definitions should override globals Breaks too much code, unless you're talking about adding a 'local' keyword, as in 'local integer x', in which case I'm in favor of it. The question would then become, is global x still accessible? Seems not, at least not without a means of qualifying them, local.x = 12, or my:x = 12 (urk - ever seen perl? You need a keyboard which has a 'my' key) > 8-- Common utilities: > boolean > FALSE > TRUE > STDERR > STDIN > STDOUT Why not? If it weren't for the fact that just about everybody has already defined TRUE and FALSE in their code, this would be fine. Which still leaves me wondering why they weren't an integral part of Euphoria from the beginning? > 9-- function indexing > s = command_line()[2] Another one that may be difficult to implement, but there are sure a lot of places where such a thing would be helpful. year = date()[D_YEAR], for example. But this doesn't go far enough, IMHO. Here's the kind of code we really need a replacement for: sequence now now = date() now = now[2] & now[3] & now[1]+1900 All that just to get the Month, Day and Year! Sheesh.... how about: now = date(M,D,Y) where M,D, and Y have a special meaning within function date() independent of any M, D or Y we may have declared in our programs? > 10- Namespaces > include get.e as G > x = G:get () Enought has been said about this one. > 11- pathlists > command line and/or .cfg file gives search paths > for include files like: ".;c:\mylibs" > SO that executing 'exw prog args' would cause Euphoria to > check 'prog.cfg' for pssible include paths. OK. That hasn't been a problem for me, but perhaps it has for others. > 12- flags > command line and/or .cfg file gives flags > exw test warn=3 -- run and set 'warn' to 3 > test.cfg: > warn = 6 -- default 'warn' > srcpth = ".;c:\temp" > ... > 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. > 14- structures > a sequence with named and typed indexes. > struct X { > integer a, > sequence b > } > struct X a => sequence a a = {0,""} > a.b = "?" => a[2] = "?" > s = append(s, X) => s= append(s,{0,""}) 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. That still leaves the pressing need for a convenient way to REFER to members of a sequence, as you mention above. > 15- Block comments Yes, but let's improve on that: Here's what I find myself doing. -- I write several lines of text, either a disclaimer, copyright, or such, -- to appear as comments. Later I need to put this same text into -- a window, or display it on the screen.. In its form as comments, I can't do that. I have to write it all over again, using "quotes, line feeds, \ttabs, and continuation characters to assign \n" & " the text to a variable. \n\n" Now, this is not a big thing, but why not simply have a command (the keyword is up for discussion) which in effect says: Euphoria, everything from this point on until the end command is to be treated like the <pre> </pre> tags in html - a preformatted piece of text. Assign it to the variable specified, and move on - there's noting to see here..... Example: pretext disclaimer = This program is copyright 2001 by Irv Mullins <irvm 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. So there! end pretext Everything, including the leading spaces and linefeeds, gets copied as is into the variable 'disclaimer', to be used where necessary. It's put in once instead of twice, and in more readable form, to boot. > 16- Exceptions > throw () causes returns until caught > much like Java 'unchecked' exceptions. > > function x () > throw (type, arg) > ... > function y () > ... > return 0 > catch (type) > ... > end Such a thing is needed. Maybe there is an even better way? > 17- Automatic 'Result' > Have each function automatically declare the object 'Result' > which is returned by default. (Much like Eiffel). > Then the following is legal > function pi () > Result = 3.14 > end function 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. Regards, Irv
8. Re: Wishlist
- Posted by david at aldred.demon.co.uk Jun 27, 2001
- 568 views
While we're on wishes... I'd like x++ and x-- to be equivalent to x +=1 and x -=1. I keep using them automatically without thinking - what comes from a past using C and enhanced Psion OPL! 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. This is actually not quite the same as s = {1,4,5.6,e/2,sin(theta) } for i=1 to 5 do (something with s[i]) next since the e/2 is allocated when the loop gets to it, not before, and e might have changed since then! -- ------------------ ------------------------- |\avid Aldred / David at aldred.demon.co.uk \ Nottingham, England |/ --------------------------------
9. Re: Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 27, 2001
- 558 views
On Wednesday 27 June 2001 19:05, kbochert at ix.netcom.com wrote: > >And as Carl pointed out, there is a definite problem with the > >seq += "a", > The wordiness I was trying to address was not the 'append', but > the redundant 'seq'. My way is a failure; Is there another way? Not that I'm aware of. > >>7-- File-local definitions should override globals Sorry, I completely misread this. You're right. > If I cant have types, I still want names. Couldn't agree more. Unique names that are tied to the sequence they index, so that you can re-use the same names to index other sequences. If only one set were allowed per include file, that would be ok. > >>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 = 0 > ... > and thinking how nice it would be if the common 'Result' were built-in. > Pretty minor! Ok, I understand now. Regards, Irv
10. Re: Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 27, 2001
- 571 views
On Wednesday 27 June 2001 17:50, david at aldred.demon.co.uk wrote: > While we're on wishes... > > I'd like x++ and x-- to be equivalent to x +=1 and x -=1. I keep using > them automatically without thinking - what comes from a past using C and > enhanced Psion OPL! Would you settle for just the x++ ? Something tells me the -- is already spoken for. > 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. > This is actually not quite the same as > > s = {1,4,5.6,e/2,sin(theta) } > for i=1 to 5 do > (something with s[i]) > next > > since the e/2 is allocated when the loop gets to it, not before, and e > might have changed since then! 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
11. Re: Wishlist
- Posted by daryl_vdb at HOTMAIL.COM Jun 27, 2001
- 574 views
>On Wednesday 27 June 2001 00:49, daryl_vdb at HOTMAIL.COM wrote: > > > >Disadvantages: > > > None - won't break any existing code. > > > > except if the existing code has a variable, constant, function or >procedure > > named "version" or "requires". > >True enough - but the same thing could be said of *any* new keyword. >Maybe I would like to create a variable named "cursor" in my program. >I can't, it's already taken. Same with 'value', 'where', etc. > >If we don't want any new keywords, then Rob can stop work on 2.3, >and save himself a lot of trouble, because there's not much he can >add. > >Of course, proper namespacing could make that a moot point, as these >two words could exist outside of user namespace. > >Regards, >Irv I agree - new keywords must be created for namespaces. It would, however, be nice if Euphoria could remain backwards-compatible. IOW, if it encounters a symbol defined with the same name as a keyword, assume the program was made for an earlier version of euphoria and allow it. And give a warning, of course.
12. Re: Wishlist
- Posted by daryl_vdb at HOTMAIL.COM Jun 27, 2001
- 573 views
>1-- Variable initialization: > integer x = 5 > ... > function foo () > sequence s = "" > ... I agree with that one. >2-- continue statement: > goes to start of for or while loop Agree with that one too. There have been plenty of times I wanted to do this. >3-- Pass-by-reference: > procedure foo (reference p1) > ... > integer x > foo (&x) -- x may be changed Prehaps a better idea: procedure foo (byref sequence s1) or: procedure foo (sequence &s1) This way you would still have type checking. >4-- Enhanced '?' > If a sequence contains all ascii characters, output it as string. It may slow down the ? statement if the interpreter always has to check whether or not all the elements of a sequence are ASCII characters. >5-- Enhanced standard library(s), possibly built-in > string functions > regular expressions > isAscii () etc. > containers >6-- slicing shorthands: > seq[2..] => seq[2..length(seq)] > seq[i..-3] => seq[i..length(seq-3)] > seq = [2..] => seq = seq[2..length(seq)] > seq += "a" => seq = append (seq, "a") The fourth one is already possible. seq &= "a" >15- Block comments That would be al right. It would allow quick commenting of entire blocks of code.
13. Wishlist
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 27, 2001
- 573 views
Hi Karl, > The wordiness I was trying to address was not the 'append', but > the redundant 'seq'. My way is a failure; Is there another way? How about borrowing some symbols used in regular expressions... seq $= "aaaa" -- Append seq ^= "aaaa" --Prepend By the way, Daryl, "&=" is not the same as append(). append() always adds ONE new element to the left hand side sequence. That being the entire right hand side object. Thus after an append() the length of LHS is always increased by exactly one. &= and & always adds AS MANY ELEMENTS as in the right side to the left hand side sequence. Thus after a concatenation '&' operation, the length of LHS is always increased by length(RHS). sequence a, b a = "abc" b = "def" a = append(a,b) ? a -- Should be { 'a', 'b', 'c', {'d', 'e', 'f'}} -- Length of a is now 4! a = "abc" b = "def" a &= b ? a -- Should be { 'a', 'b', 'c', 'd', 'e', 'f'} -- Length of a is now 6! --------- cheers, Derek Parnell Senior Design Engineer Global Technology Australasia Ltd dparnell at glotec.com.au --------------------- confidential information intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient of this message you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error please notify the sender immediately. Any views expressed in this message are those of the individual sender and may not necessarily reflect the views of Global Technology Australasia Limited.
14. Re: Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 28, 2001
- 561 views
On Thursday 28 June 2001 01:34, Tony Bucholtz wrote: > 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 OK, now I understand what you're asking. And, as it turns out, I use that kind of thing sometimes, for example, printing notices to past due accounts, extracted from a list of accounts. Here's a simple demo: procedure PrintMe(object x) ? x -- do anything you want here end procedure procedure foreach(sequence list, atom rtn) for i = 1 to length(list) do call_proc(rtn,{list[i]}) end for end procedure foreach({1,4,7,8},routine_id("PrintMe")) Problems with this include the necessity of writing both a foreach procedure and a foreach function, they are not interchangeable. And, if foreach() is made part of a library, the "include foreach.e" has to appear AFTER the PrintMe() routine, so that it can"see" the user-written PrintMe() routine. A built-in foreach() would be nice. Regards, Irv
15. Re: Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 28, 2001
- 563 views
On Thursday 28 June 2001 02:03, daryl_vdb at HOTMAIL.COM wrote: > Prehaps a better idea: > procedure foo (byref sequence s1) > or: > procedure foo (sequence &s1) > > This way you would still have type checking. Yes. However, you wouldn't know from reading the code that calls foo whether or not the parameter was being modified: Example: foo(s) You know that procedure foo() uses s, and does something, But what is the condition of s afterward? Do you know? Not without reading the source for foo(), which may be difficult, or even impossible (shrouded). You also have no control over whether s will be modified or not. So you have to save it in a temp, and restore it afterward. Not a good thing. Wouldn't it be easier to control that in YOUR code, by explicitly ALLOWING changes when you were willing to accept them: foo ( vary x) -- IF the procedure wants to and knows how, that is. foo ( x ) -- use it, but don't lose it! Regards, Irv > >4-- Enhanced '?' > > If a sequence contains all ascii characters, output it as string. > > It may slow down the ? statement if the interpreter always has to check > whether or not all the elements of a sequence are ASCII characters. > > >5-- Enhanced standard library(s), possibly built-in > > string functions > > regular expressions > > isAscii () etc. > > containers > > > > > > > >6-- slicing shorthands: > > seq[2..] => seq[2..length(seq)] > > seq[i..-3] => seq[i..length(seq-3)] > > seq = [2..] => seq = seq[2..length(seq)] > > seq += "a" => seq = append (seq, "a") > > The fourth one is already possible. > > seq &= "a" > > >15- Block comments > > That would be al right. It would allow quick commenting of entire blocks > of code. > > > > >
16. Re: Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 28, 2001
- 576 views
On Thursday 28 June 2001 01:42, daryl_vdb at HOTMAIL.COM wrote: > I agree - new keywords must be created for namespaces. It would, however, > be nice if Euphoria could remain backwards-compatible. IOW, if it > encounters a symbol defined with the same name as a keyword, assume the > program was made for an earlier version of euphoria and allow it. And give > a warning, of course. Hmmm. We're probably saving Rob a lot of time by discussing all possible repercussions of these changes. Maybe we could earn smiley bucks? If the new keywords are made a part of the Euphoria "base", then they can be overridden, and there's currently a message which warns that this is happening. If, however, they are provided in an "include" - like machine.e, get.e, etc... then they cannot be overridden. So I guess it's up to Rob. I personally think all overrides - no matter where they come from - should be handled consistently. Regards, Irv
17. Re: Wishlist
- Posted by david at aldred.demon.co.uk Jun 28, 2001
- 556 views
In message <0.1700008810.662609027-212058698-993706763 at topica.com>, Tony Bucholtz <tony_bucholtz at hotmail.com> writes > >I don't think anyone wants to change the value of the loop variable >*inside* the loop. As a matter of fact, it could be useful, but I don't think it's vital! (Example of possible usefulness - present an item from the list for user input and depending on user reaction, you may want the list of what's being processed to change: the original list has become a 'default' which can be overridden by user choices in the loop). One drawback of this is that it could be an absolute b*gger to debug when the loop does something unexpected, but, hey, that's the sort of thing which makes programming fun -- ------------------ ------------------------- |\avid Aldred / David at aldred.demon.co.uk \ Nottingham, England |/ --------------------------------
18. Re: Wishlist
- Posted by david at aldred.demon.co.uk Jun 28, 2001
- 552 views
In message <0.1700008810.333791536-738719082-993694905 at topica.com>, Irv Mullins <irvm at ellijay.com> writes >On Wednesday 27 June 2001 17:50, david at aldred.demon.co.uk wrote: > >> While we're on wishes... >> >> I'd like x++ and x-- to be equivalent to x +=1 and x -=1. I keep using >> them automatically without thinking - what comes from a past using C and >> enhanced Psion OPL! > >Would you settle for just the x++ ? >Something tells me the -- is already spoken for. Er, hadn't thought of that! (Actually, I must admit I'd always assumed the -- to start a comment needed to be precede by whitespace, but the reference doesn't say that). The ++ notation would still be nice, but if -- doesn't work then perhaps it would be more rather than less confusing to language changers... > >> 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. >> This is actually not quite the same as >> >> s = {1,4,5.6,e/2,sin(theta) } >> for i=1 to 5 do >> (something with s[i]) >> next >> >> since the e/2 is allocated when the loop gets to it, not before, and e >> might have changed since then! > >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. I hadn't realised it did that: but just because it does for the standard for-loop doesn't mean it would have to for a loop involving a sequence! Given the rather useful sequence concept, a loop through a sequence 'shorthand' could be useful even so! -- ------------------ ------------------------- |\avid Aldred / David at aldred.demon.co.uk \ Nottingham, England |/ --------------------------------
19. Re: Wishlist
- Posted by Kat <gertie at PELL.NET> Jun 28, 2001
- 572 views
On 28 Jun 2001, at 15:33, daryl_vdb at HOTMAIL.COM wrote: > >4-- Enhanced '?' > > If a sequence contains all ascii characters, output it as string. > > It may slow down the ? statement if the interpreter always has to check > whether or not all the elements of a sequence are ASCII characters. It would also break other languages. If you trim to English characters, then Igor and Red Knight and Norman can't use it. The upper ascii, which won't print in an english font, are valid printable chars in Spanish, Russian, and Japanese. > >5-- Enhanced standard library(s), possibly built-in > > string functions > > regular expressions > > isAscii () etc. > > containers If it's 8 bits, it's ascii for something or other. How about unicode? Kat
20. Re: Wishlist
- Posted by Gerardo <gebrandariz at YAHOO.COM> Jun 28, 2001
- 545 views
----- Original Message ----- From: "Tony Bucholtz" <tony_bucholtz at hotmail.com> To: "EUforum" <EUforum at topica.com> Subject: RE: Wishlist > I don't think anyone wants to change the value of the loop variable > *inside* the loop. I'd like to. For example, when I'm reading a file and something I read changes the situation. I might be processing a series of which, at start time, I can't know the top value. Or, in your own example, > sequence seqindex > seqindex = {3, 5, 10, 21, 22, 40, 45, 50, 63} > for i = 1 to length(seqindex) > seq2process[seqindex[i]] = <something> > end for What if <something> included the addition and/or deletion of elements from sequindex, hence changing its length? > 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> An excellent suggestion. > Besides, any idea for minimizing [..[]] and [][] and suchlike > syntax for sequences can't be all bad ;) > > Regards > Tony Anything that results in clearer syntax is bound to be useful. Gerardo
21. Re: Wishlist
- Posted by martin.stachon at worldonline.cz Jun 29, 2001
- 560 views
(sorry for not quoting your text with >, but my Outlook is crazy. It quotes all msgs but yours not. I'll quote my my text with *) MY WISHLIST: 1-- Variable initialization: integer x = 5 ... function foo () sequence s = "" ... * I agree. 3-- Pass-by-reference: procedure foo (reference p1) ... integer x foo (&x) -- x may be changed * This is dangerous, but may make code cleaner/faster in some cases. * Not good for newbies. 4-- Enhanced '?' If a sequence contains all ascii characters, output it as string. * {20,22,23} it's a string or sequence?. * I disagree. 5-- Enhanced standard library(s), possibly built-in string functions * especially remove n-th element of sequence regular expressions isAscii () etc. containers 6-- slicing shorthands: seq[2..] => seq[2..length(seq)] seq[i..-3] => seq[i..length(seq-3)] seq = [2..] => seq = seq[2..length(seq)] seq += "a" => seq = append (seq, "a") * I'd prefer following syntax * s[1..end] * because 'end' is already keyword and it won't collide with * existing 'end', because it cannot be inside [] 12- flags command line and/or .cfg file gives flags exw test warn=3 -- run and set 'warn' to 3 test.cfg: warn = 6 -- default 'warn' srcpth = ".;c:\temp" ... * Sounds like PHP...I disagree. * The interpreter wouldn't know when to set values of this variables * Because they may be declared at different places of code and * what if there's a value assigned to them ? * what if user wants pass to porgram 'x=3' by command line, * but don't change value of x? * You should do it by yourself with command_line() 17- Automatic 'Result' Have each function automatically declare the object 'Result' which is returned by default. (Much like Eiffel). Then the following is legal function pi () Result = 3.14 end function * I disagree. This may broke some existing code and saves you from typing * just a few words. Karl Bochert * Martin Stachon * and his Crazy Outlook Express * martin.stachon at worldonline.cz * http://www.webpark.cz/stachon
22. Re: Wishlist
- Posted by Irv Mullins <irvm at ellijay.com> Jun 29, 2001
- 545 views
On Thursday 28 June 2001 07:30, martin.stachon at worldonline.cz wrote: > 3-- Pass-by-reference: > procedure foo (reference p1) > ... > integer x > foo (&x) -- x may be changed > > * This is dangerous, but may make code cleaner/faster in some cases. > * Not good for newbies. To me, it reads 'foo (append x)' Far too much like print ( foo & bar ) Idea good, re-use of symbol bad. > 4-- Enhanced '?' > If a sequence contains all ascii characters, output it as string. > > * {20,22,23} it's a string or sequence?. > * I disagree. A key to toggle this string display on an off in the debugger. $ x to print x as a string, ? x to print x as a number, for use in code > * I'd prefer following syntax > * s[1..end] > * because 'end' is already keyword and it won't collide with > * existing 'end', because it cannot be inside [] Actually, I believe it will collide: You can have only one meaning for a keyword, regardless of the context. This is probably what makes a one-pass 'compiler' possible. > 17- Automatic 'Result' > Have each function automatically declare the object 'Result' > which is returned by default. (Much like Eiffel). > Then the following is legal > function pi () > Result = 3.14 > end function > > * I disagree. This may broke some existing code and saves you from typing > * just a few words. I would have to edit literally 100's of functions, since I 'automatically' declare result to hold the return value, unless some other word is more appropriate. Regards, Irv
23. Re: Wishlist
- Posted by Marcel Kollenaar <M.Kollenaar at SLO.NL> Jan 09, 1997
- 672 views
Hello to All, For those people who are interested in extensible languages. In Dr.Dobb's Journal, December 1996, page 26 is an article of the language 'Lua'. It looks like Euphoria, see the list construction. MK