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

Add gensym and clean or macro #143

Merged
merged 8 commits into from
Jan 26, 2016
Merged

Add gensym and clean or macro #143

merged 8 commits into from
Jan 26, 2016

Conversation

dubek
Copy link
Collaborator

@dubek dubek commented Jan 21, 2016

(Following discussion in #126)

This PR introduces gensym in the optional stage of stepA, implemented in Mal itself (part of the rep calls at the beginning of the program), and a clean or macro which doesn't shadow caller bindings.

There are separate commits for changes in tests, process, guide, core.mal, and then one commit which modifies the actual stepA code of 12 implementations (all pass the new tests of stepA).

If this looks good, I'll continue implementing the change on the rest of the implementations.

@kanaka
Copy link
Owner

kanaka commented Jan 21, 2016

Overall looks good so far. I would probably leave the core.mal loading and "->" test in step8 to keep them with the macro step and then just drop the "and" tests. I had been thinking for a while to reduce the "and" tests. Slow implementations are especially slow with macros and the "and" macro is so similar to "or" macro that the tests for it are fairly redundant. If anything, one or two tests for "->>" in step8 would be more useful since that is a more complex macro.

@dubek
Copy link
Collaborator Author

dubek commented Jan 21, 2016

OK, sounds good, I'll restore core.mal back to step8 and replace and tests by several ->> tests. Probably later tonight.

dubek added 7 commits January 22, 2016 23:47
1. `gensym` isn't yet available in step8
2. `and` tests are very slow in some implementations
3. ->> macro is more complex
4. moved core.mal to the end so it won't override the builtin `or` macro
* go
* guile
* js
* mal
* miniMAL
* ocaml
* ps
* python
* racket
* ruby
* tcl
* vimscript
* bash
* c
* clojure
* coffee
* crystal
* d
* elixir
* erlang
* forth
* lua
* make
* nim
* perl
* awk
* cpp
* cs
* es6
* factor
* fsharp
* groovy
* haskell
* java
* julia
* kotlin
* matlab
* php
* r
* rpython
* rust
* scala
* swift
* vb
@dubek
Copy link
Collaborator Author

dubek commented Jan 26, 2016

As far as I can see all implementations pass the soft test at the end of test A which tests gensym and the clean or macro.

kanaka added a commit that referenced this pull request Jan 26, 2016
Add gensym and clean `or` macro
@kanaka kanaka merged commit dc1986d into kanaka:master Jan 26, 2016
@kanaka
Copy link
Owner

kanaka commented Jan 26, 2016

Nice work.

@dubek dubek mentioned this pull request Jan 26, 2016
@dubek dubek deleted the add-gensym branch January 26, 2016 20:22
sdt added a commit to sdt/mal that referenced this pull request Feb 5, 2016
micfan pushed a commit to micfan/make-a-lisp that referenced this pull request Nov 8, 2018
Add gensym and clean `or` macro
luelista pushed a commit to luelista/mal that referenced this pull request Mar 10, 2024
Add gensym and clean `or` macro
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.

2 participants