This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Adding a new procedure to standard Scheme


Hi,

I'm trying to add a new procedure to the standard Scheme in Kawa. The procedure is called write-ss and it's supposed to be a new procedure in the lib.ports file, defined like so,

(define (write-ss value #!optional (out (current-output-port))) :: <void>
  (*:format (kawa.standard.Scheme:.sharedWriteFormat) value out))

The idea is for it to pick up a sub-class of DisplayFormat called SSDisplayFormat, so I added the following to kawa.standard.Scheme,

defProcStFld("write-ss", "kawa.lib.ports");

and

public static final AbstractFormat sharedWriteFormat = new SSDisplayFormat(true, 'S');

SSDisplayFormat is just overriding #writeList and #writeObjectRaw from DisplayFormat.

So everything compiles fine, but I get the following exception in the REPL when I try to make sure it's picked up,

#|kawa:3|# write-ss
<unknown>: exception loading 'write-ss' - null

I realise I haven't shown you what's happening in SSDisplayFormat, just because it's quite long and I figured the problem is I'm not registering the new procedure properly in Kawa.

Any thoughts?

Thanks for your time,

Charlie.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]