wisp-lang / wisp

A little Clojure-like LISP in JavaScript
https://gozala.github.io/wisp/
Other
982 stars 68 forks source link

repl:Fix slicing first character(#141) #144

Closed pocka closed 7 years ago

pocka commented 8 years ago

Fixed #141 .

This bug occurred in node v0.11.7 or later due to node's changing behaviour of its repl.

Until node v0.11.6, user input string passed to evaluate function always wrapped with paren.

> 1+1;
'(' + '1+1;' + '\n' + ')'

So, wisp's repl removes this automatically added parens by (subs code 1 (- (count code) 1)) (code=user input string).

But since this commit , only input string wrapped with curly brace would be wrapped with paren, other inputs are passed directly. Additionaly, position of \n is also changed (to tail, not inside of parens).

> 1+1;
'1+1;' + '\n'
> { a: "b" }
'(' + '{ a: "b" }' + ')' + '\n'

..But wisp's repl doesn't know this, so it removes first and last character and tries to evaluate it. This causes slicing first character (and last LF) in node v0.11.7~.

=> (console.log "wisp") ;; '(console.log "wisp" )\n' -> 'console.log "wisp")'
 SyntaxError: Unmatched delimiter 

Checking the last character of input string is equal to checking node version(\n:v0.11.7~ , ):~v0.11.6). So this workaround does:

(Sorry for my poor English)

elsehow commented 8 years ago

@Gozala is this project abandoned?

sterpe commented 8 years ago

Been quite a while since he's responded to any issues here.

On Tue, Mar 29, 2016 at 4:21 PM, nick merrill notifications@github.com wrote:

@Gozala https://github.com/Gozala is this project abandoned?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/Gozala/wisp/pull/144#issuecomment-203155025

Gozala commented 8 years ago

Hi, sorry for not replying earlier. Unfortunately I no longer have a time, I could dedicate to this project. It's especially hard to justify putting more effort into it since ClojureScript overcomed JVM dependency which was a primary motivation for this project.

I will update readme to reflect that.

Thanks for you interest in helping out & I apologize not being more responsible at handling issues and pulls.

Gozala commented 8 years ago

https://github.com/Gozala/wisp/blob/master/Readme.md#project-is-abandoned

pocka commented 8 years ago

Thanks for replying, Gozala.

It's sad that Wisp is abandoned, but I'm waiting for someone becoming a new maintainer or you getting passion for this project again!

elsehow commented 8 years ago

thank you @Gozala

although i agree that clojurescript is excellent, and getting stronger, it is still not easy to integrate with existing js tools like browserify, npm... and, it is heavily reliant on the google closure compiler, which creates bundles that are small, but do not play well outside that ecosystem (for example, you cannot use html-inline on closure bundles).

my hope for a homoiconic js with good npm interop is still alive, as a fork of clojurescript or as an extension of wisp. thank you @Gozala for your work on wisp.