Re: mainly syntax
- Posted by Irv Mullins <irv at ELLIJAY.COM> Feb 18, 1998
- 786 views
At 06:01 PM 2/18/98 +1100, Graeme wrote: >The '=' operator already performs a very useful task with relation to >sequences. When I first got a PD copy of Eu1.4, it was this very section of >docs that convinced me to invest my time in learning the language. >Operations on sequences are one of Euphoria's great strengths, if you're >not using them, you're missing half the point. Way more than half, in my opinion. I don't see those features used nearly as much as they could be in contributed code. >Using the 'end' keyword in sequence slices would make for neater code Yes! Clarity counts, especially six months or five years from now, when you have to maintain your code. (I still maintain business programs I wrote 12 years ago - sometimes it's hard to remember just what a piece of code is supposed to do) Every little bit helps. >I too would like to see the power() routine replaced with an operator. The ^ is generally understood to stand for power, and it's not being used for anything else, is it? I don't understand the problem with zero - based vs 1 - based indexing, unless you're trying to use basic code without re-writing. Why would there be any reason to continually adjust the index s[x-1] ? What's wrong with calling the first item [1] and the second item [2]...etc.? Re: Procedures/Functions I suppose we could replace *procedure foo()* with *void function foo()*, but where's the gain? The way it is, we don't have to look up each call to see if it returns anything, and we can't call a function without actually doing something with the result (kinda important). One thing that might lead to shorter, clearer code would be to allow var parameter passing to procedures. Turbo Pascal allows this, and I use it maybe 10% of the time. Most of the time, it is because Pascal functions can only return 1 result, and I need several, so I use a procedure (var a,b,c) instead. Other times it is because the call is more readable than a function assignment would be. Enough... Irv ---------------------------------------------------------------------------- ----------- Outside an English photographer's studio: OUT TO LUNCH: IF NOT BACK BY FIVE, OUT FOR DINNER ALSO ---------------------------------------------------------------------------- -----------