Waldek Hebisch
unread,Aug 6, 2025, 9:31:59 PMAug 6Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fricas...@googlegroups.com
I have now added new code to make calls from Boot to Spad.
There is macro SpadFun which is used like:
$SPADRREAD_fun := [0, nil]
SPADRREAD(stream, key) ==
fun := SpadFun($SPADRREAD_fun,
getFunctionFromDomain1("read", '(BasicKeyedAccessFile),
'(None), '((BasicKeyedAccessFile) (String))))
SPADCALL(stream, key, fun)
That is first argument is a variable name, the second one is
call to lookup function which searches for a given Spad function.
Main point of SpadFun is that the variable is a cache: first
field may be 0, 1 or 2. 0 means it was not called, so of
course need lookup. 1 means that there was one call. However,
cached value may contain 'newGoGet', in such case Spad part of
lookup still needs to be done. Only after second call we
know that function is fully resolved, so we can use cached
value.
There is also function 'clear_callbacks' in 'clam.boot'. It is
called if a constructor is recompiled. clear_callbacks' is
supposed to clear all variables used as caches. Without clearing
Boot would use cached value, so call old functions (a not the
new re-compiled ones). Currently one has to manually add
all caching variables to 'clear_callbacks'. ATM there are
two such variables. There will be more, but I do not
expect many of them and they should change rather slowly,
so hopefully manual update will not be a problem.
--
Waldek Hebisch