Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Name CFunctions #60

Closed
simonbates opened this issue Aug 22, 2015 · 0 comments
Closed

Name CFunctions #60

simonbates opened this issue Aug 22, 2015 · 0 comments

Comments

@simonbates
Copy link
Owner

When I am further with my serialization and implementation of image-based storage [#7], I will need some way to name CFunctions.

Right now, if I implement table printing, I would get something like this for a signal:

{ step <CFunction> }

But which CFunction?

Sketch of an initial idea:

  1. a hash table storing mapping from string name to function pointer
  2. functions must be registered in this hash table
  3. the CFunction object includes the name in addition to the function pointer
  4. SetGlobalCFunction takes a name (which is looked up in table 1) rather than a function pointer directly
  5. when we print a CFunction we get <CFunction:NAME> or such
  6. when we read <CFunction:NAME>, we look up the table 1

MakeCFunction would also take a name rather than a function pointer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant