[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: code snippet



But then there's the following fun:

IDL> key= 1  &  print,(['first','second','third','fourth'])[[key]]
second
IDL> key= 3  &  print,(['first','second','third','fourth'])[[key]]
fourth
IDL> key= 5  &  print,(['first','second','third','fourth'])[[key]]
fourth
IDL> key= -999  &  print,(['first','second','third','fourth'])[[key]]
first

Which is a "feature" when you expect it, and a bug when you don't :)


				Brian