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

Home » Public Forums » archive » Re: code snippet
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: code snippet [message #25294 is a reply to message #25293] Tue, 29 May 2001 15:03 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Dick Jackson" <dick@d-jackson.com> writes:
> choice = (['first','second','third','fourth'])[key]

Heh heh, and just to be archane, why not try these:

choice = (['first','second','third','fourth'])(key)
choice = (['first','second','third','fourth'])([key])
choice = (['first','second','third','fourth'])[(key)]

One of these four expressions has a slightly different meaning than
the other. As a trivia test to the newer users of IDL on the
newsgroup (or the older ones!), can you say which one is different?
[ And why ? ]

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to set path?
Next Topic: Sorting and image rescaling

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

Current Time: Wed Oct 08 13:04:53 PDT 2025

Total time taken to generate the page: 0.00435 seconds