Re: Wishlist

new topic     » goto parent     » topic index » view thread      » older message » newer message

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
|/             --------------------------------

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu