Re: Growing a data type?
- From: "John Thingstad" <jpthing@xxxxxxxxx>
- Date: Fri, 31 Oct 2008 17:39:14 +0100
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
.
- Follow-Ups:
- Re: Growing a data type?
- From: Ali
- Re: Growing a data type?
- References:
- Growing a data type?
- From: Ali
- Growing a data type?
- Prev by Date: Re: Growing a data type?
- Next by Date: Re: Symbol clashes: how to avoid them. Part 2
- Previous by thread: Re: Growing a data type?
- Next by thread: Re: Growing a data type?
- Index(es):
Relevant Pages
|