Re: questions about callback#

Bernd Paysan <[email protected]>
Newsgroups gmane.comp.lang.forth.gforth
Message-ID <1634991.NQVXvcRJUL@daiyu>
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;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAltg78QACgkQ9y2Uk5Mt
oGf1qg/8Cb4YMCJqX+CNDzf8b/1HG6JB0K8Au3U+6RK30Kh5vWsbdqoLjWJVVq5F
cQfkumD+3jcpWM1R/97nW6FPSuNLWNa4yDcG3qNowgrz8CUVYyhyAYJr93UmxxUS
vWvv28rVzrw39OLarSjr8bz9/5zwtanjpjrBwbrjXgXT7ekqFTCLmtZqLXRaK9bI
7W4cY2VlHpnTotuhuDVyWInJtIcllL3ZeWlWwVn7qPT9dTJ/8D1VIhVmlG/ta6m7
XiFAGOT/DLLbYj1CKL22udJJR8q8Z3+D+UfqH7dm9+pQEfh1/vBULlNQ5E5Y3ntg
rfUDBe+95lgw3ac4uddm+XPk6UQHCvnL2vlrk17jXfFwlKKtc9oXsPIl2XwG2EQs
2UnvmXcbVlst3c7qb/R04Cs+93IB5L6+QNR4uAEnNVWC7t8f57FpAnyw2slIyLE0
zpZpj966BE1OSfedJLqDZiVz57C2CexcZDAfKzIPAMkaw4CULI1cerRCK0M7YccS
5U96faY1GMblbmqlaMGIUhBTAIVWC8O5+QcNAY5uQ//D/NVxWUs7c3LEA6ACLWMi
HISB+53XebunxkhfgteV+kKHlYct9QzNe+SUgt6m5JDfOTZsl2hdeVGXucZaG7zK
yQX2mIei7KRc9YsOJl56nesRS1Ze54AT9/KwxDScTCCJbJtAIno=
=mExZ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.