<tankf33der>
there is no single destination, so this is not A*
<beneroth>
good point
orivej has joined #picolisp
reed has joined #picolisp
<reed>
Hi All. I'm trying to get something like (dm-macro 'f) -> '(de f () (=: x 100))
<reed>
Right now I have (de dm-macro X (let C (car X) '(dm `C () (=: x 100))))
<reed>
but it isn't expanding C to the correct symbol
<Regenaxer>
I can answer a little later
<reed>
Thanks!
<Regenaxer>
ok, ready :)
<Regenaxer>
hmm, 'dm' is "define method", not macro
<Regenaxer>
Are you aware what the ` read macro means?
<Regenaxer>
It is a *read* macro
<Regenaxer>
So the value of C at the moment when this expression is read is inserted
<reed>
And "let" won't bind C until the function dm-macro is actually called?
<beneroth>
yeah, its not executed unless called
<Regenaxer>
let binds when the expression is executed
<Regenaxer>
yes
<Regenaxer>
moment again ;)
<reed>
Is there any way to get the behavior I'm looking for? I should note that I meant to write (dm-macro 'f) -> '(dm f () (=: x 100))
<beneroth>
I don't understand yet what you want to do :)
<beneroth>
a function 'dm-macro which binds a function definition to the symbol you give it?
<reed>
correct. But specifically a method definition
<Regenaxer>
back
<reed>
To be used with cclass
<reed>
*class
<Regenaxer>
the 'dm' function pushes the method into the value of *Class
<Regenaxer>
let me give an example
<Regenaxer>
This "defines" a method "foo>" for class '+A':
<Regenaxer>
(push '+A '(foo> (X) (:= x X)))
<Regenaxer>
(de dm-macro (F) (push *Class (cons F '(() =: X 100))))
<Regenaxer>
Not tried :)
<beneroth>
a function (or method) in picolisp is just a list, first parameter being the argument list (or the symbol @ for a varying number of evaluated parameters, or another symbol for a varying number of unevaluated parameters, or a cons pair to combine the different types of parameters) followed by expressions (the function body)
<Regenaxer>
T
<reed>
Ahhh, that seems reasonable. I'll see if I can make something like that work
<Regenaxer>
yeah
<Regenaxer>
does not need 'push' of course, any list operations will do
<beneroth>
for OOP in picolisp: the methods are stored in the value of the Class symbol. the name of the symbol being the class, the properties of the symbol being its attributes (or relationships when using pilDB), and the value is a list of parent classes/objects, followed by the method definitions.
<Regenaxer>
yes, but "name of the symbol being the class," should be "the value ..."
<beneroth>
T
<Regenaxer>
ie the superclass(es)
<beneroth>
there is not 'really' a differentiation between classes and objects in picolisp. in usage there is, but not in the technical implementation
<beneroth>
Regenaxer, did MacLisp have a symbol type similar to picolisp? The symbol type of picolisp seems to be pretty unique in todays lisps...
<beneroth>
(afaik)
<Regenaxer>
Yes, symbols were central to Lisp always
<Regenaxer>
(as opposed to Scheme, and (?) Clojure)
<Regenaxer>
CL still has them in full power
<beneroth>
really? the CL (and Clojure) guy I talked with was pretty surprised about picolisps symbol type
<reed>
So I tried (de dm-macro (F) (push *Class (cons F '(() (=: x 100))))) but when I run (dm-macro 'a>) then call (a> my-shape) It says "a> -- undefined"