From: John Connors
Subject: Python-style tuples in Lisp
Date: 
Message-ID: <445e2ec1$0$549$ed2619ec@ptn-nntp-reader03.plus.net>
This is all it takes (alhtough I'd really like to know if it's portable 
- I'm not entirely sure).

(defun |#{-reader| (stream char arg)
    (declare (ignore char arg))
     `(values ,@(read-delimited-list #\} stream t)))

(set-dispatch-macro-character #\# #\{ #'|#{-reader|)
(set-macro-character #\} (get-macro-character #\) nil))

I'm still gobsmacked by the extensibility of this thing; it must be 
possible to use it to embed a languge with an almost entirely different 
syntax whithin Lisp this way.

Like, for instance..errrr..C?


-- 
+--------------------------------------------------------+
|Cyborg Animation Programmer    |    ·····@yagc.ndo.co.uk|
|http://badbyteblues.blogspot.com -----------------------|
+--------------------------------------------------------+

From: Pascal Costanza
Subject: Re: Python-style tuples in Lisp
Date: 
Message-ID: <4c6sgtF14d4bsU1@individual.net>
John Connors wrote:
> This is all it takes (alhtough I'd really like to know if it's portable 
> - I'm not entirely sure).
> 
> (defun |#{-reader| (stream char arg)
>    (declare (ignore char arg))
>     `(values ,@(read-delimited-list #\} stream t)))
> 
> (set-dispatch-macro-character #\# #\{ #'|#{-reader|)
> (set-macro-character #\} (get-macro-character #\) nil))
> 
> I'm still gobsmacked by the extensibility of this thing; it must be 
> possible to use it to embed a languge with an almost entirely different 
> syntax whithin Lisp this way.
> 
> Like, for instance..errrr..C?

Yes, although that's probably not a good idea.

Google for CGOL for a full example.


Pascal

-- 
3rd European Lisp Workshop
July 3-4 - Nantes, France - co-located with ECOOP 2006
http://lisp-ecoop06.bknr.net/
From: John Connors
Subject: Re: Python-style tuples in Lisp
Date: 
Message-ID: <445e529f$0$530$ed2619ec@ptn-nntp-reader03.plus.net>
Pascal Costanza wrote:
> John Connors wrote:
> 
>> This is all it takes (alhtough I'd really like to know if it's 
>> portable - I'm not entirely sure).
>>
>> (defun |#{-reader| (stream char arg)
>>    (declare (ignore char arg))
>>     `(values ,@(read-delimited-list #\} stream t)))
>>
>> (set-dispatch-macro-character #\# #\{ #'|#{-reader|)
>> (set-macro-character #\} (get-macro-character #\) nil))
>>
>> I'm still gobsmacked by the extensibility of this thing; it must be 
>> possible to use it to embed a languge with an almost entirely 
>> different syntax whithin Lisp this way.
>>
>> Like, for instance..errrr..C?
> 
> 
> Yes, although that's probably not a good idea.
> 
True, why would you want to lobotomize a perfectly good Lisp compiler 
like that :-)

> Google for CGOL for a full example.
> 
> 
> Pascal
> 
It might have other uses - for instance transforming some L-system 
grammar that has been iterated over umpteen times into geometric 
primitives. Might be handy, one day...

-- 
+--------------------------------------------------------+
|Cyborg Animation Programmer    |    ·····@yagc.ndo.co.uk|
|http://badbyteblues.blogspot.com -----------------------|
+--------------------------------------------------------+
From: John Connors
Subject: Re: Python-style tuples in Lisp
Date: 
Message-ID: <4461c64a$0$5931$ed2619ec@ptn-nntp-reader01.plus.net>
Nicolay Giraldo wrote:
> I believe that lisp is a better language to write compilers than C or
> C++, the same way that C is a better language to write system code that
> runs in a very small memory and Fortran or even Ocaml are better to
> write numeric code than the rest.
> 
> So if GCC was written in lisp then it would not be the slow slug it is.
> And would have had full C++ support several years ago, would optimize
> better, and would be much more extensible.
> 
> However it seems even the idea was banned by lispers saying "C?! how
> awful you should learn lisp!" and C users saying, I just want to use
> something for my job please stop trying to convert me. Then I'm
> probably wrong, if someone knows better please tell me.
> 
You want to implement gcc in Lisp? Great, post us the code when you are 
done! ;-)

I agree that there is a strong argument for Lisp as a language of choice 
for implementing Algolish compilers (and a lot of other symbolic 
manipulation systems) - but the trouble is that I'm not interested in 
programming in C anymore, so why should I implement it? Maybe if I was 
in a production environment and all I could find was 'C' programmers. 
Which might happen, one day. It's nice to know I've got the option, but 
my immediate problems are more estoric (with one exception) and 'C' 
would be a hindrance - I want to focus on my problem space, not resource 
management! So, yes, it comes down to the tool for the job for me, as 
well. Which happens to be Lisp, right now.

-- 
+--------------------------------------------------------+
|Cyborg Animation Programmer    |    ·····@yagc.ndo.co.uk|
|http://badbyteblues.blogspot.com -----------------------|
+--------------------------------------------------------+
From: Nicolay Giraldo
Subject: Re: Python-style tuples in Lisp
Date: 
Message-ID: <1147281662.922984.273610@y43g2000cwc.googlegroups.com>
No, I would like to see GCC team learning lisp and implementing GCC in
it. Neither you or me know enough of GCC internals to implement it, I
guess.

My problem was solved going to other compiler (borland free comand line
tools), and I don't have to wait as I had to before.

It always comes to the right tool for the job, for everyone.