ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
Re: LISP macros vs Ruby procs ?
by Rick DeNatale other posts by this author
Nov 7 2009 6:35AM messages near this date
Re: LISP macros vs Ruby procs ? | Re: LISP macros vs Ruby procs ?
On Fri, Nov 6, 2009 at 3:05 PM, lith <minilith@[...].com>  wrote:
> > LISP's ` (the backtick) is roughly equivalent to Ruby's eval with a
> > string, right?
> 
>  That like saying a string is equivalent to an array/list. In lisp, a
>  macro can take the arguments transform it using the usual set of list-
>  related functions and generate the code for the macro. In scheme, you
>  can use some sort of structured pattern matching to generate the code.

The enabling feature of Lisp which makes its macros possible is
homoiconicity, which means that the external representation of a lisp
program is exactly a  human-readable form of the internal executable
representation, plus the fact that this internal representation is a
fundamental data-type of the language.

This means that Lisp code can manipulate and generate the internal
executable program representation directly and macros are really just
Lisp procedures which do just that.

http://en.wikipedia.org/wiki/Homoiconicity
http://c2.com/cgi/wiki?DefinitionOfHomoiconic

-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
Thread:
Aldric Giacomoni
David Masover
Ryan Davis
Lith
Rick DeNatale
Lith
Aldric Giacomoni
Marnen Laibow-Koser

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved