guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble with returning parameters passed in to C primitives.


From: Daniel Hartwig
Subject: Re: Trouble with returning parameters passed in to C primitives.
Date: Fri, 7 Dec 2012 09:59:44 +0800


On Dec 7, 2012 5:51 AM, "Richard Shann" <address@hidden> wrote:
> If I pass 'a in as a parameter I get something back which prints on the
> console as (quote a) but which is not eq? to 'a

You seem to be double quoting the value.  No need for ' the second time.

> I can pass in a string and get an equal? string back. But what I really
> want to do is pass in a procedure and execute it if I get it back, thus
>
> (set! choice (d-PopupMenu (list '("Offset Position" . do-offset))))

Here you pass the symbol "do-offset" rather than the value.  read up on quote and quasiquote syntax.  Use unquote to insert the /value/ of do-offset:

(set! choice (d-PopupMenu (list `("Offset Position" . ,do-offset))))

or:

(set! choice (d-PopupMenu (list (cons "Offset Position" do-offset))))

> (#f Wrong type to apply: ~S (do-offset) #f)
>

You are trying to apply a list contain a symbol, when it should just be a procedure: no list or symbol.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]