Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional procedure signature for primitives and library procedures (wishlist) #260

Open
jpellegrini opened this issue Sep 3, 2021 · 1 comment

Comments

@jpellegrini
Copy link
Contributor

Hi @egallesio !
Not an essential thing, but I thought it would be nice to have a configure option that would turn signature generation early so the user could see signatures of imported libraries/SRFIs and core procedures.

@jpellegrini jpellegrini changed the title Optional procedure arity for primitives and library procedures (wishlist) Optional procedure signature for primitives and library procedures (wishlist) Sep 3, 2021
@jpellegrini
Copy link
Contributor Author

Some comments:

  1. About core procedures:

In stklos.h, we have

struct primitive_obj {
  stk_header header;
  char *name;
  SCM (*code)();
  SCM plist;
};

#define PRIMITIVE_NAME(p)       (((struct primitive_obj *) (p))->name)
#define PRIMITIVE_FUNC(p)       (((struct primitive_obj *) (p))->code)
#define PRIMITIVE_PLIST(p)      (((struct primitive_obj *) (p))->plist)

I suppose we could also support formals here. Then, the user would opt for either compiling the formals with the C code or not compiling them - that would be a compile-time option. And if the user decides not to include the formals, they should not take any extra space in the generated binary (that's easy to do :)

  1. bonus.stk, other closures (non-primitives) that come with STklos core, libraries and SRFIs:

Also a compilation option, I suppose, that would turn the parameter compiler:keep-formals on or off before compiling those...

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

No branches or pull requests

1 participant