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

Home » Public Forums » archive » Re: Principle of Least Surprise
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: Principle of Least Surprise [message #52092] Tue, 09 January 2007 15:14 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
... and
a[3:5].x=bindgen(3)
works perfectly!

It makes sense though... consider this case:
IDL> b=replicate({x:intarr(10)},10)
IDL> b[3].x = indgen(4)

IDL must understand that the specified array is the values of X in b[3].
If what you had written was working, IDL would not know if it is the
values of X or if it is the 1st value of 4 entries of b...

Jean

JD Smith wrote:
>
> Violated again. Consider:
>
> IDL> a=replicate(1b,10)
> IDL> a[3]=bindgen(3)
> IDL> print,a
> 1 1 1 0 1 2 1 1 1 1
>
> but now:
>
> IDL> a=replicate({x:1b},10)
> IDL> a[3].x=bindgen(3)
> % Expression must be a scalar in this context: <BYTE Array[3]>.
> % Execution halted at: $MAIN$
>
> This ought to work.
>
> JD
>
[Message index]
 
Read Message
Read Message
Previous Topic: Principle of Least Surprise
Next Topic: Re: Writing on an image

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

Current Time: Sat Oct 11 11:03:08 PDT 2025

Total time taken to generate the page: 1.51986 seconds