caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David McClain" <barabh@qwest.net>
To: <caml-list@inria.fr>
Subject: [Caml-list] Missing Symbols
Date: Thu, 6 Dec 2001 17:12:28 -0700	[thread overview]
Message-ID: <000901c17eb3$db4a7420$210148bf@dylan> (raw)

Hi,

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
lacking.

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
substitutions:

E.g., the template file might read,

#ifdef __GENERATE_PROTOS__
~~(:c-function-prototypes)
#endif

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?

Cheers,

- 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


                 reply	other threads:[~2001-12-07 14:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000901c17eb3$db4a7420$210148bf@dylan' \
    --to=barabh@qwest.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).