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]

Re: GSOC | Extending Common Lisp support


On 1 June 2012 00:02, Per Bothner <per@bothner.com> wrote:
> Note that funcall is a function, not a macro. ÂIt should be easy enough to
> implement as a short Java method or a CommonList function that
> invokes Procedure#applyN.

I implemented this using the APPLY function in primitives.lisp:

(defun apply (func &rest (args :: <Object[]>))
  (invoke (the <function>
	       (if (symbolp func) (symbol-function func) func))
	  'applyN
	  (invoke-static <gnu.kawa.functions.Apply>
				  'getArguments
				  args
				  0 #'apply)))

(defun funcall (func &rest args)
  (apply func args))

Passes the examples given in the hyperspec at least.

> where %flet is implemented using kawa.standard.let,
> except you need to do:
> Âdecl.setProcedureDecl(true);

I'd be inclined to do a dispatch on the syntax name, so in the
protected method something like:

if (this.getName().equals("flet")) then decl.setProcedureDecl()

but that's quite awkward with the static instances being used in these
syntax objects. What's the motivation for the static instances in
these syntax objects? I added constructors which set the syntax name
per object, and it seems to work OK, though I haven't tested whether
my FLET satisfies the semantics of the standard yet, but the method of
implementing it seems to work.

Thanks,
Charles.


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