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

Home » Public Forums » archive » Is this a bug?
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: Is this a bug? [message #13049 is a reply to message #12978] Fri, 02 October 1998 00:00 Go to previous messageGo to previous message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
Stein Vidar Hagfors Haugan wrote:
> Whenever you put brackets around anything *but* a simple variable,
> IDL makes a temporary variable (a "right hand value" - rvalue) out
> of it, and *then* decides how to do stuff outside the
> brackets. This is *why* putting brackets around e.g., function
> calls will allow you to do this: print,(size(a))[0].
>

As a side note, it is this same behavior which allows you to perform
another useful trick, often overlooked:

b=(a=val)

This will assign val to b and a in one shot. Furthermore,

d=(c=(b=(a=val)))

will work just as well.

See, rvalues aren't all bad.

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How do you like this?
Next Topic: Copying IDL objects

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

Current Time: Sun Oct 12 13:07:22 PDT 2025

Total time taken to generate the page: 2.08166 seconds