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

Implements alias expansion for JVM #150

Merged
merged 1 commit into from
Aug 21, 2019
Merged

Conversation

djblue
Copy link
Contributor

@djblue djblue commented Aug 14, 2019

Fixes #106

@dundalek
Copy link
Owner

wow, that was fast!

I am pretty busy this week, but will hopefully be able to take a closer look and test it over the weekend.

@dundalek
Copy link
Owner

Very nice, works great 👍

I found an issue for multi-line cases, here's a sample case:

;; Lets define a sample var and access its value
closh $ (def hi "hello")
#'user/hi
closh $ (str hi)
"hello"
closh $ (str
   #_=>  hi
   #_=>  )
"hello"

;; Bug: By introducing an alias we will shadow a variable even inside clojure form
;; (Because we process input on per line basis)
closh $ (defalias hi "echo hi")
closh $ (str
   #_=>  hi
   #_=>  )
Syntax error compiling at (REPL:0:0).
Unable to resolve symbol: echo in this context

But the case is kind of artificial and not very likely to be encountered, so I am thinking of merging the PR as is and opening an issue to be tackled later (with other multi-line fixes or when the time will come for custom grammar implementation).

@dundalek dundalek merged commit 5fefeda into dundalek:master Aug 21, 2019
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.

JVM: defalias doesn't work?
2 participants