From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA16099; Fri, 7 Dec 2001 15:42:03 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA15969 for caml-list@pauillac.inria.fr; Fri, 7 Dec 2001 15:42:03 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA05186 for ; Fri, 7 Dec 2001 01:11:34 +0100 (MET) Received: from tcsnpop1.tcsn.uswest.net (tcsnpop1.tcsn.uswest.net [207.108.112.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id fB70BXb04544 for ; Fri, 7 Dec 2001 01:11:33 +0100 (MET) Received: (qmail 29046 invoked by uid 50); 7 Dec 2001 00:11:31 -0000 Delivered-To: fixup-caml-list@inria.fr@fixme Received: (qmail 29020 invoked by uid 0); 7 Dec 2001 00:11:31 -0000 Received: from 216-161-146-204.customers.uswest.net (HELO dylan) (216.161.146.204) by tcsnpop1.tcsn.uswest.net with SMTP; 7 Dec 2001 00:11:31 -0000 Message-ID: <000901c17eb3$db4a7420$210148bf@dylan> From: "David McClain" To: Subject: [Caml-list] Missing Symbols Date: Thu, 6 Dec 2001 17:12:28 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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