Re: object and sequence
- Posted by Brian Broker <bkb at CNW.COM> May 04, 2000
- 433 views
On Wed, 3 May 2000 20:02:43 +0200, <tone.skoda at SIOL.NET> wrote: >we dont need sequences >becuase you can allways use object instead of seuqence type > >is object type slower or what? Think of an object as a generic container that can hold either atoms or sequences. I can't comment on any speed issues related to declaring a variable as an object or sequence (but I'd bet that working with sequences is faster than working with objects simply because it is more specific). If you have a function that can return either an atom or a sequence, then you should declare the receiving variable as an object. (See examples for 'gets' function in the reference manual... the variable 'line' is declared an object because 'gets' could return either a sequence or an atom.) If you want to make sure that your variable only holds a sequence, then you should declare it as a sequence (for error checking and possibly faster execution speed). -- Brian