[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [spr7631] Defining a Macro

 >> It's not really clear from your message what you want your macro to do. ...

I would like to construct RHET Statements for inserting facts in the RHET
database. --RHET is a knowledge representation tool developed at the University of
Rochester--. Facts are represented in RHET by expressions of the form
   [pred-name arg0 .. argn].
For example [Parent [John] [Mary]] may be interpreted as "John is a parent of
Mary" or [Dog [Snoopi]] for "Snoopi is a dog".
And what I want is a macro or function that for example takes two arguments, 
arg1 and arg2, and constructs an expression representing the fact "arg2 ist a
arg1"; .i.e., [arg1 [arg2]]. 
To resume I like to define a function 'build-rhet-axiom' such that the evaluation
of (build-rhet-axiom 'dog 'snoopi) returns the expression '[dog [snoopi]].

As I reported in my previous message the simple definition

      (defmacro BUILD-MY-EXPRESSION (arg1 arg2)
  	`'(rassert [,arg1 [,arg2]]))

didn't work; the evaluation of the form (BUILD-MY-EXPRESSION 'test1 'test2) 
returned (rassert [,arg1 [,arg2]]) instead of (rassert [test1 [test2]]).
It worked as soon as I replace the square brackets by any other alphabetic

I hope the formulation of the problem is now clear enough.

Sorry for the inconveniences my first message might be caused.