| Did you know ... | Search Documentation: |
| Send methods |
<-feedback
equals report Invoke object->report
using error<-kind, error<-format
and the arguments passed. This message is sent to the object that
generated the error using object->error.<-feedback
equals print Use’@pce error->format’to
print the message. If error<-kind
is
error, start the PCE tracer.<-id, error<-format, error<-kind
and error<-feedback.
The default kind is warning and the default feedback
is report. The
error object is locked
against the garbage collector and a mapping from its error<-id
is added to the @errors
database.
The following provides a (schematic example).
:- new(_, error(key_clash,
'%N: Key %s is already in use')).
:- pce_begin_class(database, hash_table).
add(DB, Record:record) :->
"Add record to the database"::
get(Record, key, Key),
( get(DB, member, Key, _)
-> send(DB, error, key_clash, Key),
fail
; send(DB, append, Key, Record)
).
:- pce_end_class.
See also object->report.