Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

macros are possible in prolog too right?

152 views
Skip to first unread message

Terrence Brannon

unread,
Apr 30, 2009, 1:15:26 PM4/30/09
to
I was reading the intro to "Let Over Lambda" -
http://letoverlambda.com/index.cl/guest/chap1.html

where the author says """Macros are the single greatest advantage that
lisp has as a programming language and the single greatest advantage
of any programming language. With them you can do things that you
simply cannot do in other languages."""


but it is possible to write programs that assert new clauses in
Prolog.

So, from my perspective, the macro facility of Lisp, can be emulated
in Prolog.

pjlm...@gmail.com

unread,
Apr 30, 2009, 3:16:31 PM4/30/09
to
On Apr 30, 6:15 pm, Terrence Brannon <metap...@gmail.com> wrote:
> I was reading the intro to "Let Over Lambda" -http://letoverlambda.com/index.cl/guest/chap1.html

Take a look at the term expansion mechanism available in some Prolog
compilers.

Cheers,

Paulo

A.L.

unread,
Apr 30, 2009, 3:23:33 PM4/30/09
to

... and goal expansion...

See "The Kraft of Prolog"; there is quite a bit about term expansion
and using them as "prolog macro"

A.L.

0 new messages