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

Execution error instead of syntax for 08 #857

Closed
mfikes opened this issue Feb 4, 2019 · 0 comments
Closed

Execution error instead of syntax for 08 #857

mfikes opened this issue Feb 4, 2019 · 0 comments

Comments

@mfikes
Copy link
Member

mfikes commented Feb 4, 2019

$ plk
ClojureScript 1.10.516
cljs.user=> 08
Execution error (ExceptionInfo) at (<cljs repl>:1).
Invalid number: 08.

Instead, expecting a syntax error as we get in JVM ClojureScript

$ cljs
ClojureScript 1.10.565
cljs.user=> 08
Syntax error reading source at (REPL:1).
<NO_SOURCE_FILE> [line 1, col 3] Invalid number: 08.
mfikes added a commit that referenced this issue Mar 11, 2019
mfikes added a commit that referenced this issue Mar 11, 2019
mfikes added a commit that referenced this issue Mar 13, 2019
mfikes added a commit that referenced this issue Mar 15, 2019
mfikes added a commit that referenced this issue Mar 15, 2019
* Add with-in-str (#874)

* Update copyright / date in man page (#879)

* Document using Boot to generate a classpath file (#876)

Planck can access dependencies that are specified on its classpath.
These can be specified by hand but an alternative is to use a tool like
Boot to output the dependencies to a file that can then be fed into
Planck. This PR adds documentation to the Planck docs that explains how
this can be done and closes #343.

It's noted that, due to the introduction of tools.deps and Planck's
support for it via `plk`, this is less important than it was at the
time of the initial discussion.

* Support interning quoted data structures (#508) (#884)

Planck provides an `intern` function in `planck.core` that is similar
to Clojure's `clojure.core/intern`. Whereas Clojure's version calls out
to a Java class, Planck `eval`s a `def` statement defining the name and
value to be interned.

The prior implementation in Planck used syntax quoting to generate the
`def` form. The problem with this was that certain data structures that
would be passed to `planck.core/intern` as a quoted argument would be
unquoted in the `def` form. Depending on the data structure, this could
then cause an error.

A simple example that demonstrates the problem is passing a symbol as
the value to be bound. Calling `(planck.core/intern *ns* 'foo 'bar)`
would result in one of two things, both of which were wrong. If 'bar`
were not bound, Planck would report an error when `bar` was unquoted
because no value existed. If `bar` were bound, that value would be
interpolated. In neither case would `foo` be bound to the symbol `bar`.

This commit adds support for quoted data structures by quoting any value
that is passed to `planck.core/intern`. This takes advantage of the fact
that quoting has no effect on most data structures. For example, `'5`
results in `5`. This closes #508.

* Execution error instead of syntax for 08 (#881)

Fixes #857
mfikes added a commit that referenced this issue Mar 15, 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

No branches or pull requests

1 participant