Re: Eu improvements (part 4)
- Posted by c.k.lester <euphoric at cklester.com> Jan 05, 2007
- 688 views
Matt Lewis wrote: > euclass foo( sequence f ) > integer bar, baz > function foo( integer bar, integer baz ) : foo > foo this > this = repeat( 0, 2 ) > this.bar = bar > this.baz = baz > return this > end function > > procedure print() > ? this.bar > ? this.baz > end procedure > end euclass By this, don't we then already have structured sequences (SS) in Euphoria?!?! -- simple example euclass Address( sequence s ) atom street_number sequence street_name sequence city sequence state atom zip_number atom zip_plus4 end euclass This seems to allow both structured sequences (at its simplest) and advanced objects (at its most complex). address myAddress -- create your new structured sequence myAddress.street_number = 1234 myAddress.street_name = "Independence Pkwy" It's just called a euclass instead of a sequence/record/etc.