English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Missing Symbols
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-12-07 (14:42)
From: David McClain <barabh@q...>
Subject: [Caml-list] Missing Symbols

On a number of occaisions now, I have been faced with the need for "symbols"
in the language -- most notably some syntactic items that can be read from a
script at runtime and used internally to represent themselves uniquely.

This can be synthesized with strings and hashtables holding "unique" copies
of these string items, but that requires a clumsy syntax in the scanned text
files, e.g., "aSymbol" instead of something like #aSymbol (sans quotes). I
tend to make my symbols case insensitive. It also requires a fair amount of
internal code scaffolding to support these items.

I find it a curious omission from languages aimed at symbolic computation,
not to have a type Symbol along the lines of the keyword symbol package in
Lisp. I do understand that union types can serve as just this -- inside the
program code. But that still leaves the connection to the outside world

The particular prompt for this feature re-arose when I tried to program a
smart scripting program that can take a description of foreign interfaces,
run it against a prewritten template text file, and perform intelligent

E.g., the template file might read,


which is used by the program along with a list of abstract, langauge
independent, interface specifications. The symbol here
":c-function-prototypes" is carried into the template reader and used as a
hashtable lookup key for the function to perform this request. The
tilde-paren is the tip off that a symbolic request is about to be made.
Otherwise, all the text in the template file is simply written to the output
file as is.

Any thoughts on why the language decision was made to elide symbolic items?


- David McClain, Sr. Scientist, Raytheon Systems Co., Tucson, AZ
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr