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

Home » Public Forums » archive » Re: Fun Writing Books
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Fun Writing Books [message #46705] Wed, 14 December 2005 09:14
Emmanuel Christophe is currently offline  Emmanuel Christophe
Messages: 11
Registered: March 2004
Junior Member
Reimar Bauer a écrit :
> FÖLDY Lajos wrote:
>
>> Hi,
>>
>> just a little experiment:
>>
>> IDL> print, !version
>> { sparc sunos unix 5.3 Nov 11 1999}
>> IDL>
>> IDL> s={n:'s',i:1} & t={t:'',ii:2} & help,[s,t]
>> % Conflicting data structures: T,concatenation.
>> % Execution halted at: $MAIN$
>> IDL>
>>
>> regards,
>> lajos
>
>
>
> This must go wrong and this is different about the one we are speaking here.
>

Mine doesn't go wrong:

IDL> print, !version
{ x86 linux unix linux 6.2 Jun 20 2005 32 64}
IDL> s={n:'s',i:1} & t={t:'',ii:2} & help,[s,t]
<Expression> STRUCT = -> <Anonymous> Array[2]
IDL>

Emmanuel


>
>
>
> IDL> a = {Name:'Larry', Age:46}
> IDL> b = {Name:'JoeBob', Age:39}
> IDL> c = [a, b]
>
>
> Please show your results to this here.
>
> cheers
>
> Reimar
>
>
>
>>
>> On Wed, 14 Dec 2005, Reimar Bauer wrote:
>>
>>
>>
>>> Mark Hadfield wrote:
>>>
>>>
>>>> Reimar Bauer wrote:
>>>>
>>>>
>>>>
>>>> >I believe this wasn't restricted. Both are anonymous structures not
>>>> >named!
>>>>
>>>>
>>>> Concatenation of anonymous structures in the way David describes
>>>> definitely used to be forbidden. Each anonymous structure has an
>>>> internally generated identifier and IDL used to insist that these match,
>>>> which effectively meant the only way to create an array of anonymous
>>>> structures was replication. This restriction was removed a few versions
>>>> back (don't recall when) and IDL now tries to do the sensible thing.
>>>>
>>>>
>>>
>>> But then it was always possible. I have used this often in the past
>>> versions too
>>>
>>> Reimar
>>>
>>>
>>> --
>>> Reimar Bauer
>>>
>>> Institut fuer Stratosphaerische Chemie (ICG-I)
>>> Forschungszentrum Juelich
>>> email: R.Bauer@fz-juelich.de
>>> ------------------------------------------------------------ -------
>>> a IDL library at ForschungsZentrum Juelich
>>> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
>>> ============================================================ =======
>>>
>
>
>
Re: Fun Writing Books [message #46713 is a reply to message #46705] Wed, 14 December 2005 05:14 Go to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
Yes, the change in behaviour is documented in the IDL 5.4
"what's new", on section "Relaxed Rules for Combining Structures".

Ciao,
Paolo


F�LDY Lajos wrote:
> OK, here you are:
>
> IDL> print, !version
> { sparc sunos unix 5.3 Nov 11 1999}
> IDL>
> IDL> a = {Name:'Larry', Age:46}
> IDL> b = {Name:'JoeBob', Age:39}
> IDL> c = [a, b]
> % Conflicting data structures: B,concatenation.
> % Execution halted at: $MAIN$
> IDL>
>
> regards,
> lajos

>>>> >
>>>> >
>>>> >>I believe this wasn't restricted. Both are anonymous structures not
>>>> >>named!
>>>> >
>>>> >
>>>> >Concatenation of anonymous structures in the way David describes
>>>> >definitely used to be forbidden. Each anonymous structure has an
>>>> >internally generated identifier and IDL used to insist that these match,
>>>> >which effectively meant the only way to create an array of anonymous
>>>> >structures was replication. This restriction was removed a few versions
>>>> >back (don't recall when) and IDL now tries to do the sensible thing.
>>>> >
>>>> >
>>>>
>>>> But then it was always possible. I have used this often in the past
>>>> versions too
>>>>
>>>> Reimar
>>>>
>>>>
Re: Fun Writing Books [message #46714 is a reply to message #46713] Wed, 14 December 2005 04:31 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
OK, here you are:

IDL> print, !version
{ sparc sunos unix 5.3 Nov 11 1999}
IDL>
IDL> a = {Name:'Larry', Age:46}
IDL> b = {Name:'JoeBob', Age:39}
IDL> c = [a, b]
% Conflicting data structures: B,concatenation.
% Execution halted at: $MAIN$
IDL>

regards,
lajos


On Wed, 14 Dec 2005, Reimar Bauer wrote:

> FÖLDY Lajos wrote:
>> Hi,
>>
>> just a little experiment:
>>
>> IDL> print, !version
>> { sparc sunos unix 5.3 Nov 11 1999}
>> IDL>
>> IDL> s={n:'s',i:1} & t={t:'',ii:2} & help,[s,t]
>> % Conflicting data structures: T,concatenation.
>> % Execution halted at: $MAIN$
>> IDL>
>>
>> regards,
>> lajos
>
>
> This must go wrong and this is different about the one we are speaking here.
>
>
>
>
> IDL> a = {Name:'Larry', Age:46}
> IDL> b = {Name:'JoeBob', Age:39}
> IDL> c = [a, b]
>
>
> Please show your results to this here.
>
> cheers
>
> Reimar
>
>
>>
>>
>> On Wed, 14 Dec 2005, Reimar Bauer wrote:
>>
>>
>>> Mark Hadfield wrote:
>>>
>>>> Reimar Bauer wrote:
>>>>
>>>>
>>>> >I believe this wasn't restricted. Both are anonymous structures not
>>>> >named!
>>>>
>>>>
>>>> Concatenation of anonymous structures in the way David describes
>>>> definitely used to be forbidden. Each anonymous structure has an
>>>> internally generated identifier and IDL used to insist that these match,
>>>> which effectively meant the only way to create an array of anonymous
>>>> structures was replication. This restriction was removed a few versions
>>>> back (don't recall when) and IDL now tries to do the sensible thing.
>>>>
>>>>
>>>
>>> But then it was always possible. I have used this often in the past
>>> versions too
>>>
>>> Reimar
>>>
>>>
>>> --
>>> Reimar Bauer
>>>
>>> Institut fuer Stratosphaerische Chemie (ICG-I)
>>> Forschungszentrum Juelich
>>> email: R.Bauer@fz-juelich.de
>>> ------------------------------------------------------------ -------
>>> a IDL library at ForschungsZentrum Juelich
>>> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
>>> ============================================================ =======
>>>
>
>
> --
> Reimar Bauer
>
> Institut fuer Stratosphaerische Chemie (ICG-I)
> Forschungszentrum Juelich
> email: R.Bauer@fz-juelich.de
> ------------------------------------------------------------ -------
> a IDL library at ForschungsZentrum Juelich
> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
> ============================================================ =======
>
Re: Fun Writing Books [message #46715 is a reply to message #46714] Wed, 14 December 2005 04:21 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
F�LDY Lajos wrote:
> Hi,
>
> just a little experiment:
>
> IDL> print, !version
> { sparc sunos unix 5.3 Nov 11 1999}
> IDL>
> IDL> s={n:'s',i:1} & t={t:'',ii:2} & help,[s,t]
> % Conflicting data structures: T,concatenation.
> % Execution halted at: $MAIN$
> IDL>
>
> regards,
> lajos


This must go wrong and this is different about the one we are speaking here.




IDL> a = {Name:'Larry', Age:46}
IDL> b = {Name:'JoeBob', Age:39}
IDL> c = [a, b]


Please show your results to this here.

cheers

Reimar


>
>
> On Wed, 14 Dec 2005, Reimar Bauer wrote:
>
>
>> Mark Hadfield wrote:
>>
>>> Reimar Bauer wrote:
>>>
>>>
>>>> I believe this wasn't restricted. Both are anonymous structures not
>>>> named!
>>>
>>>
>>> Concatenation of anonymous structures in the way David describes
>>> definitely used to be forbidden. Each anonymous structure has an
>>> internally generated identifier and IDL used to insist that these match,
>>> which effectively meant the only way to create an array of anonymous
>>> structures was replication. This restriction was removed a few versions
>>> back (don't recall when) and IDL now tries to do the sensible thing.
>>>
>>>
>>
>> But then it was always possible. I have used this often in the past
>> versions too
>>
>> Reimar
>>
>>
>> --
>> Reimar Bauer
>>
>> Institut fuer Stratosphaerische Chemie (ICG-I)
>> Forschungszentrum Juelich
>> email: R.Bauer@fz-juelich.de
>> ------------------------------------------------------------ -------
>> a IDL library at ForschungsZentrum Juelich
>> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
>> ============================================================ =======
>>


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
Re: Fun Writing Books [message #46716 is a reply to message #46715] Wed, 14 December 2005 03:58 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
Hi,

just a little experiment:

IDL> print, !version
{ sparc sunos unix 5.3 Nov 11 1999}
IDL>
IDL> s={n:'s',i:1} & t={t:'',ii:2} & help,[s,t]
% Conflicting data structures: T,concatenation.
% Execution halted at: $MAIN$
IDL>

regards,
lajos


On Wed, 14 Dec 2005, Reimar Bauer wrote:

> Mark Hadfield wrote:
>> Reimar Bauer wrote:
>>
>>> I believe this wasn't restricted. Both are anonymous structures not
>>> named!
>>
>>
>> Concatenation of anonymous structures in the way David describes
>> definitely used to be forbidden. Each anonymous structure has an
>> internally generated identifier and IDL used to insist that these match,
>> which effectively meant the only way to create an array of anonymous
>> structures was replication. This restriction was removed a few versions
>> back (don't recall when) and IDL now tries to do the sensible thing.
>>
>>
>
> But then it was always possible. I have used this often in the past
> versions too
>
> Reimar
>
>
> --
> Reimar Bauer
>
> Institut fuer Stratosphaerische Chemie (ICG-I)
> Forschungszentrum Juelich
> email: R.Bauer@fz-juelich.de
> ------------------------------------------------------------ -------
> a IDL library at ForschungsZentrum Juelich
> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
> ============================================================ =======
>
Re: Fun Writing Books [message #46717 is a reply to message #46716] Wed, 14 December 2005 02:33 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Mark Hadfield wrote:
> Reimar Bauer wrote:
>
>> I believe this wasn't restricted. Both are anonymous structures not
>> named!
>
>
> Concatenation of anonymous structures in the way David describes
> definitely used to be forbidden. Each anonymous structure has an
> internally generated identifier and IDL used to insist that these match,
> which effectively meant the only way to create an array of anonymous
> structures was replication. This restriction was removed a few versions
> back (don't recall when) and IDL now tries to do the sensible thing.
>
>

But then it was always possible. I have used this often in the past
versions too

Reimar


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
Re: Fun Writing Books [message #46737 is a reply to message #46717] Sun, 11 December 2005 18:04 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark Hadfield writes:

> Concatenation of anonymous structures in the way David describes
> definitely used to be forbidden. Each anonymous structure has an
> internally generated identifier and IDL used to insist that these match,
> which effectively meant the only way to create an array of anonymous
> structures was replication. This restriction was removed a few versions
> back (don't recall when) and IDL now tries to do the sensible thing.

I think everyone should be made to write a book occasionally.
There is no end to the things I am learning (or, in some cases,
re-learning). But, honestly, this muse is brutal. She got me
up at 3:45 AM this morning to work on the pointer section
of the data chapter. :-(

Cheers,

David

P.S. Let's just say I really liked it a lot better when she
just refused to work with me on my tennis game. At least I
got a little bit of sleep from time to time.

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Fun Writing Books [message #46738 is a reply to message #46737] Sun, 11 December 2005 16:57 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Reimar Bauer wrote:
> I believe this wasn't restricted. Both are anonymous structures not named!

Concatenation of anonymous structures in the way David describes
definitely used to be forbidden. Each anonymous structure has an
internally generated identifier and IDL used to insist that these match,
which effectively meant the only way to create an array of anonymous
structures was replication. This restriction was removed a few versions
back (don't recall when) and IDL now tries to do the sensible thing.


--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: Fun Writing Books [message #46739 is a reply to message #46738] Sun, 11 December 2005 00:07 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:

> Folks,
>
> You know what's fun about writing books? You have so
> many opportunities to embarrass yourself. :-)
>
> When did this get fixed?
>
> IDL> a = {Name:'Larry', Age:46}
> IDL> b = {Name:'JoeBob', Age:39}
> IDL> c = [a, b]
>
> That, my friends, is *suppose* to generate an error.
>
> http://www.dfanning.com/tips/concatenate_structs.html
>
> Now, I've got to check every single piece of code I ever wrote
> to be sure I'm not missing something else. :-(
>
> Cheers,
>
> David
>

Hi David,

I believe this wasn't restricted. Both are anonymous structures not named!

There was a restriction with named structures and I think you like to talk
about this one. A rule change and when will we get this fixed ....

IDL> a=make_array(5,2,1)
IDL> help,a,reform(a,5,2,1)
A FLOAT = Array[5, 2]
<Expression> FLOAT = Array[5, 2, 1]


IDL> a=ptr_new(reform(a,5,2,1))
IDL> help,*a
<PtrHeapVar2> FLOAT = Array[5, 2, 1]


I like to see the reform output always


cheers
Reimar
Re: Fun Writing Books [message #46744 is a reply to message #46739] Thu, 08 December 2005 21:27 Go to previous message
m_schellens is currently offline  m_schellens
Messages: 31
Registered: February 2005
Member
Yes, some quiet improvements.
The structures nowadays (at least till 6.0) only need the same
patterns, even the tag names can differ
(the one of the first struct are taken):
IDL> s={n:'s',i:1}
IDL> t={t:'',ii:2}
IDL> help,/STRUCT,[s,t]
** Structure <92b911c>, 2 tags, length=16, data length=14, refs=2:
N STRING 's'
I INT 1
IDL> help,/STRUCT,[t,s]
** Structure <92b9224>, 2 tags, length=16, data length=14, refs=2:
T STRING ''
II INT 2

Ah, did I mention that GDL behaves the same way :-)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Polygon Clipping Algo in IDL
Next Topic: Re: Recursive Function Program in IDL

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

Current Time: Wed Oct 08 13:48:47 PDT 2025

Total time taken to generate the page: 0.07411 seconds