Re: unexpected semantics with using lists as default elements in tables



In article <1233e9c2-bca6-407d-804f-c64a199d6b41@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Jan <storkchen@xxxxxxxxx> wrote:

Anyone else ran into this one? Is this fixable without too much
trouble in the implementation? I'd be happy to hear your comments
about this.

Other languages, such as perl, as this little feature called
"auto-vivification" which does about what you'd like, namely, it creates
a new list that will be automatically used whenever necessary.

But then, you don't say you want a default list value, perl just makes
it so -> so this loses a bit of checking (perl has specific operators
for lists).

Considering that Icon has similar typed values (e.g., || vs. |||, the compiler
used to use this for type inference ), I believe that auto-empty lists
would work, with not too surprising results.

E.g., not give a default value, and have put magically work on those
values by creating new lists out of nowhere.
.



Relevant Pages

  • Reg. Directory listing program
    ... I am new to this mailing list and I am very new to PERL. ... I wrote a code that lists files in a directory with the permissions. ... Directory listing program ...
    (perl.beginners)
  • Re: Can this be done (by a noob :))
    ... Perl has "modules" for handling specific tasks. ... The script would read the list and set the first pid in list as current ... Next is the new sid list created in the previous step, ... always excistant) lists. ...
    (comp.lang.perl.misc)
  • Re: Question on a perlsub statement.
    ... to send an eof so perl know it finished reading ALL the lines. ... assignment has all to do with it. ... perl6 will be able to do this due to lazy lists and ...
    (comp.lang.perl.misc)
  • Re: __DATA__ and in Forth
    ... I did not realise that perl was working one line at a time, ... compile-time; embedding a file is comparatively primitive. ... Maybe for lists of data that you want to embed in the compiled ...
    (comp.lang.forth)
  • Emulating Generators: Iterators for Lists (Newbie)
    ... achieving various things in Perl. ... What would be a good way to do an iterator for a sequence of values to be ... sub-routine, and declare the state you need to maintain between sub calls ... lists which might be the answer. ...
    (comp.lang.perl.misc)