Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Artyom Bologov
@aartaka@merveilles.town  ·  activity timestamp 2 weeks ago

An opinion: #Lisp, #Scheme, and #CommonLisp macros should also include type information, not only forms to process. The language(s) are typed, after all!

Luckily, this can be added on top of the existing macro system with… macros! And some compiler internals for type inference, in the order of what trivial-arguments are doing (disclosure: I’m the one that contributed type info fetching there.) With that and some syntax processing, one can infer the type of a given expression in like 80% of cases (might be less than that on non-SBCL compilers, but I have to test that.) And then act on it with a knowledge of what types there are.

I had a use-case for this when playing with CRUNCH, but it eludes me now. You have to believe me on the usefulness of types in macros.

  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.8 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login