Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!ucbvax!hplabs!otter!kers From: kers@otter.hpl.hp.com (Christopher Dollin) Newsgroups: comp.lang.misc Subject: Re: What is B&D? (Re: Bondage and Discipline Languages) Message-ID: <2400020@otter.hpl.hp.com> Date: 18 Jan 89 09:24:45 GMT References: <2670@ficc.uu.net> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 30 Erland Sommarskog said: | But to throw some new wood on the fire, consider the following: Assume | you have routine you want to call but whose name you don't know until | run-time, thus you have the name in a string. Now in which langauges | can you easily do this? Interpreting langauges like Lisp and Basic, | support this I guess. But compiled langauges? It's not a matter of compiled vs interpreted; you can map strings to the contents of the so-named variables in compiled Lisp. The question is: how much information about the names of things is left lying around at run-time? In Lisp, the symbols (and their values) are part of the language, and so can be interrogated by the running code. Of course it's likely to be *easier* in an interpreted language, since the interpreter has to keep all that stuff around anyway. Example compiled language that lets you call a routine known by a string: Pop11. Code to do so: (the_string.consword.valof)( args ) or, if you prefer prefix notation rather than dotted suffixing: valof( consword( the_string ) )( args ) Caveats on request. Regards, Kers. "If anything anyone lacks, they'll find it all ready in stacks."