[Oberon] How to mimic an associative array
dukeofperl at ml1.net
Thu Dec 2 18:36:25 CET 2010
On Thu, 2 Dec 2010, Jan Verhoeven wrote:
> > FORM[name]="Duke"
> > FORM[age]=63
> That's easy.
> CONST name = 0;
> age = 1;
> sex = 2;
> address = 3;
> and then just index as you wish.
Not quite! I'm writing a generic CGI library/module. This module
should import/implement associative arrays so that _any_ QUERY_STRING
content can be processed.
My various CGI scripts will then IMPORT the CGI module which will
"export" certain procedures to "process" QUERY_STRING, PATH_INFO AND
> > Associative array functionality is built into Perl, so we never had
> > to deal with the implementation details. I would have though that
> > after all these years, Oberon would have had a module kicking around
> > that offered the same functionality.
> Oberon development has halted many years ago.
> Also, it's hard to express the associative thingy in an EBNF formula.
> Perl, Python, Tcl. These are scripting tools for quick and dirty scripts
> that are needed today. Not tomorrow anymore. Then a new one is needed.
The quick and dirty, are _still_ around; still being developed; still
very useful. :) Have a look at CPAN: http://www.cpan.org/
> Unfortunately the world has accepted scripting tools as a programming
> environment. Eating up many processor cycles. Eating up lots of energy.
> Killing the icebears in your back yard. :o)
Using the correct for the job! Have a tool-belt with a few "good"
tools. Scripting languages are one of the tools. I'm trying to adapt
O2 to a venue that has traditionally been serviced by interpreted
scripting tools. Although that not quite true. When the Web was first
developed, CGI scripts were really compiled C programs - the source
code living in "cgi-src" and the binary living in "cgi-bin". That's
where we get the familiar /cgi-bin/ URL segment. :)
More information about the Oberon