gforth
[Top][All Lists]
Advanced

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

Re: [gforth] questions about callback#


From: Bernd Paysan
Subject: Re: [gforth] questions about callback#
Date: Wed, 01 Aug 2018 01:24:52 +0200

Am Mittwoch, 1. August 2018, 00:11:34 CEST schrieb Reepca Russelstein:
> callback# is used both at generate-time (in words used by
> callback-gen) and at first-instantiation-time. If the two values don't
> match, bad things happen (in my case, I attempted to pass a function
> pointer pointing to address 14. Yikes).
> 
> Example:
> 
> c-library test
> 3 to callback#
> c-callback used-rarely -- void
> 20 to callback#
> c-callback used-frequently n -- void
> end-c-library
> 
> ' noop used-rarely .
> 
> Prints 8 for me - it tries to access the 19th callback of
> used-rarely... seems that ccb-num should be set at generate-time
> rather than setup-time.

Yes, makes sense, when you use callback# like this (and you should be able to 
do so).

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;address@hidden(dQ*
https://net2o.de/

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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