comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Order of argument evaluation (Was: Re: making a checkerboard array?)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Order of argument evaluation (Was: Re: making a checkerboard array?) [message #56013 is a reply to message #56008] Wed, 26 September 2007 07:18 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Allan Whiteford wrote:
> [...]
>
> Anyway, the real point of my post is to ask if I'm allowed to do the
> above. For a more reasonable example am I allowed to do:
>
> plot,(x=findgen(11)),x^2
>
> and rely on the first argument of plot being evaluated before the second
> argument (and the side effect of creating 'x') similarly for creating an
> array and editing in place, e.g.:
>
> IDL> ((a=fltarr(3)))[1]=10
> IDL> print,a
> 0.00000 10.0000 0.00000
>

I guess a danger signal would be appropriate
near such statements, after all this can quickly
get out of control ;-)

IDL> delvar,c
IDL> c[(c=[0,1])]=(c=[1,2,3])
IDL> print,c
1 1 3

Now, go figure this one out...

Ciao,
Paolo











> Does anyone else do this or just me? I tend to only do things like this
> at the command line and don't embed it in programs out of fear that
> it's going to stop working one day. It also arguably makes the code less
> readable but as a pattern it's probably not that bad. I'd like to know
> what others think.
>
> Thanks,
>
> Allan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: create geotiff
Next Topic: Re: selection box in widget program

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 17:15:55 PDT 2025

Total time taken to generate the page: 0.88178 seconds