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

Intrusive changes in the make implementation #606

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

asarhaddon
Copy link
Contributor

Please find details are in the commit header.

@dubek
Copy link
Collaborator

dubek commented Feb 1, 2022

Have you noticed this PR includes changes to make but also to ruby.2, vb, python.2? Is that intentional?

@asarhaddon
Copy link
Contributor Author

Not exactly. This work is based on #592, but only needs the Make parts. I have cherry-picked the interesting commits. Thanks.

Readability
* Use implicit parameter transmission ($(_list?) instead of $(call
  _list?,$1),
  first/lastword instead of word 1/words,
  $1 instead of $(1).
* Use an undefined $(rem) macro and some automatic stripping (if,
  foreach) to indent code with less calls to `strip` functions.
* Name the Make macro implementing a MAL core function exactly like the
  function (modulo the encoding above) and simplify core_ns accordingly.
* Replace empty results representing `nil` with explicit MAL values.
* Implement large conditionals with a computed variable name, as already
  done in printer.mk.  For QUASIQUOTE and EVAL, this reduces a lot the
  diff between steps.
* Represent the reader state as an explicit global variable instead of
  passing the same name as argument again and again.
* Merge read-atom into read-form so that the switch on first character
  is more visible.

Encapsulation
* Hide most representations into types.mk.
* Implement the type as a suffix in order to avoid a conditional in
  _obj_type.
* Implement _error with throw.
* Create distinct types for keywords and macros.
* Move most metadata and atom stuff from core.mk to types.mk.
* Move parameter association from env to types because it hides more
  about the representation of functions.

Representation
* Encode Make special characters in all strings/keywords/symbols, so
  they can be used directly as spaced words and/or variable names for
  map keys. (The encoding adding separating characters is kept for
  read-string and seq).
* Change representation of numbers/strings/keywords/symbols, reducing
  the number of Make variables.

Various
* Allow keyword argument for keyword core function.
* Shorten time-mes,slurp,readline...
* Remove obsolete stuff:
  * `get` and `contains?` for vectors
  * `count` for hash-maps
  * `_join` from util.mk.
  * `type` from core.mk.
* Add a function listing env_keys for DEBUG-EVAL.
* Fix some includes.
@asarhaddon
Copy link
Contributor Author

The only remaining failure is elm, which is completely unrelated (#608 ).

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

Successfully merging this pull request may close these issues.

None yet

2 participants