Re: Growing a data type?



På Fri, 31 Oct 2008 12:08:03 +0100, skrev Ali <emailaliclark@xxxxxxxxx>:

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?

I don't expect this to be answered because I don't think I know any
language which can do this, but it would be nice to see how much of
string could be implemented in Lisp.

A string is just a array of characters. make-string is thus just a convenient shorthand for (make-array ... :element-type 'character) Much of the magic like utf16 encoding vs. uft8 vs. iso-lating-1 etc. happen at the character level. As for the "string" syntax, that is handled at the reader level. define-reader-macro and friends. All of this could be defined/redfined in Lisp if you want to. In fact most of Lisp is written in Lisp. Most Lisp implementations only use C to bootstrap Lisp and for the garbage collector. (Ok so there is a FFI and a few other things.)

--------------
John Thingstad
.



Relevant Pages

  • Re: Very poor Lisp performance
    ... > Do you mean it is difficult to implement infix in Lisp? ... I mean that designing a *good* macro system for an infix language is ... >> operates on code needs to operate at the abstract syntax level, ...
    (comp.lang.lisp)
  • Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
    ... >> the language should be available to users. ... In the design of Common Lisp, I asked Dave Moon (one of the architects ... Now, there are good kinds of low-level, like the way that floats are ...
    (comp.lang.lisp)
  • Re: CollabRx seeks brilliant engineers for an excellent e-science adventure
    ... belief that lisp programmers are smarter/better. ... Java or PHP programmers. ... a type of language that attracts a personality that meets my perceptions ...
    (comp.lang.lisp)
  • Re: Whats the best language to learn...
    ... on processors designed to run Lisp and Lisp OSes. ... byte-addressed memory, has native support for variable-sized value types, ... popular OO language, rather a language about like that of Delphi would have ... lisp, java, ruby, etc. ...
    (comp.programming)
  • Re: Program compression
    ... TM> supported by your favorite language (LISP) are good concepts. ... then call the Java compiler to compile that source file to a Class ... TM-STC> Since static type checking makes run-time type checks unnecessary, ...
    (comp.programming)