Re: Growing a data type?



In article
<ea699e19-00ba-4aa6-a976-395cbf4c97f2@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Ali <emailaliclark@xxxxxxxxx> wrote:

Hi,

Just watched Guy Steele's Growing a Language (http://video.google.com/
videoplay?docid=-8860158196198824415), very impressive.

Lisp got plus points for being able to abstract both abstract syntax
and function calls.

Here's a (hopefully) fun question: If Lisp didn't have a string data
type already, could you grow one which was indistinguishable from the
standard implementation, including double quote delimiters?

You could do it using CLOS. You would define a STRING class that held
the data, define a PRINT-OBJECT method that prints it using double quote
syntax, and a read-macro on double-quote that constructs new strings.

--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.



Relevant Pages

  • Re: Is anything easier to do in java than in lisp?
    ... And any experienced lisp ... in java generally you hardly ever use ... static String showInputDialog(Component parentComponent, ... which was about generic sequences (lists ...
    (comp.lang.java)
  • Re: Is anything easier to do in java than in lisp?
    ... And any experienced lisp ... in java generally you hardly ever use ... static String showInputDialog(Component parentComponent, ... which was about generic sequences (lists ...
    (comp.lang.lisp)
  • Re: (In)Efficient snmpwalk parsing...
    ... I've written some lisp which does stuff with switch forwarding ... I want to extract the port number and the MAC address (do- ... (parse-integer (fourth spline)) ... to parse the string. ...
    (comp.lang.lisp)
  • Re: Lisp puns considered good style?
    ... > While transcribing, I've run across another punning example, so I ... Yes, the Lisp system can disambiguate, and yes, ... Ask yourself a similar question about poetry. ... How is poetry like (string string)? ...
    (comp.lang.lisp)
  • Re: static, dynamic and implicitely typed languages
    ... (char "sure I'm a string" 1) ... That is instead of declaring the type of the argument, Lisp language ... Functions like char and car have to check that the type of the passed argument is correct. ...
    (comp.lang.lisp)