Re: Named Elements (Was Re: Eu improvements (part 3))
- Posted by c.k.lester <euphoric at cklester.com> Jan 04, 2007
- 562 views
Karl Bochert wrote: > c.k.lester wrote: > > > > sequence my_seq is > > atom one=1, two=2, three=3 > > end sequence > > > > my_seq seq1 > > > > -- can used named parameters or dot notation > > ? seq1['one'] -- 1 > > ? seq1.one -- 1 > > ? seq1['test'] -- NULL? error? > > I'm confused here. > seq1.one is a euphoria object with a value, just as foo is after > atom foo > Therefore seq1.test is an error because it has not been defined. Right. I was throwing out a test case that should cause an error... But in these cases, you might need to ask isDefined( seq1, 'test' ) or somesuch... especially working with dynamic or user-generated data/metadata. > Is seq1['one'] the same thing written with a different syntax? Yes.