Re: mutable object model
Alan Baljeu <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
>One may view a psi-term as a generalization of conventional
>Prolog terms in that subterm positions are specified by explicit numeric
>keywords rather than implicit numeric positions."
>
>So this would be a psi-term:
> car(manufacturer => "Ford", wheels => 4)
>as would this:
> car(wheels => N)
>*and* these two psi-terms can be unified, giving
> N = 4.
Just as a matter of program maintenance I use macros in
Prolog to achieve this, such that in my code
#car(manufacturer: "Ford", wheels : 4)
maps at compile time into
car("Ford", _, _, 4, _)
-- if I declared car as a struct -- and then of course unification just works.
>There's even more: There is a notion of inheritance between functors
>("sorts"), so given appropriate declarations, one of the terms could have
>the functor 'vehicle', for instance. It's an interesting read.
This would be so handy for what I'm doing now, but I don't have a means.
In any event, my expectation is the map would be dynamic without fixed arity.
-------------- next part --------------
HTML attachment scrubbed and removed