Re: Attempt at approximating Lisp's "macroexpansion"

Alan Baljeu <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Question: Does C-c C-b do the right thing?  In my practice I would do this:

1 ?- [arec_mod].
Then I expect everything else you did to work, but there could be a bug somewhere.


Alan

arec_mod.pl:
:- module(arec_mod,[]).
:- use_module(library(record)).
:- record arec(afield:atom='').

Then, I compiled it from the editor with C-c, C-b.  Back in the top-level:

2 ?- module(arec_mod).
true.

arec_mod: 3 ?- expand_term(:- record arec(afield:atom=''),Res).
ERROR: Syntax error: Operator expected
ERROR: expand_term(:- record 
ERROR: ** here **
ERROR: arec(afield:atom=''),Res) .

Now, even if I consult library(record) from the default working module:

arec_mod: 4 ?- [library(record)].


The "record" atom is still not recognized as an operator:

arec_mod: 5 ?- current_op(1150,fx,record).
false.
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.