| Did you know ... | Search Documentation: |
| Send methods |
->value.
Note that attribute<-convert
convert an attribute name into an
attribute object
with value @nil.
->value<->catch_all
are called by PCE's message-passing system if there is no other
definition for a method. Class sheet
uses these methods to store and fetch attributes:
?- new(@s, sheet(name, age, address)), send(@s, name, gnu). ?- get(@s, name, X). X = gnu
This approach has, besides its definite charm, one drawbacks:
Attributes whose name collide with a method name cannot be accessed this
way. Code that handles unknown attribute names should use sheet<->value
to avoid this problem.
<-members.
Arguments:
@arg1 attribute object
?- new(Sheet, sheet(attribute(name, gnu),
attribute(age, 100))).
name with object. If the sheet
already has an attribute with this name, the value of the attribute is
changed. Otherwise a new attribute with the given name and value is
appended to the sheet.
->send_catch_all ->append