chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
Rowan Barnard 2020-08-04T23:26:21.378200Z

Was just working through some exercise in the Olsen's book Getting Clojure in Chlorine and when I tried to submit one of the forms for evaluation nothing happened

Rowan Barnard 2020-08-04T23:27:50.379Z

Here is the code that I was working on: (def ISBN-LENGTH 13) (def OLD-ISBN-LENGTH 10) (defn valid-isbn [isbn] (or (= (count isbn) OLD-ISBN-LENGTH) (= (count isbn) ISBN-LENGTH)))

Rowan Barnard 2020-08-04T23:34:51.382700Z

I then type (valid-isbn 05967) to test it out (not realizing at the time that count doesn't work on a number) and when I attempt to submit with Sean Corfield's Ctrl+;Shift+B (the Atom keymap for REBL Top Block) then nothing happens, I don't get any result, any error message or anything

Rowan Barnard 2020-08-04T23:37:50.384900Z

If I type (valid-isbn "05967") and submit for evaluation it works as expected, so not sure why using a number as the argument results in nothing happening - is this some protection mechanism to prevent me entering incorrect inputs?

phronmophobic 2020-08-04T23:40:38.386400Z

05967 isn't valid in clojure (number literals can't start with 0). however, valid-isbn won't work on numbers because count only works on collections and a number is not a collection

Rowan Barnard 2020-08-04T23:41:49.387600Z

OK but shouldn't it still evaluate and blow up with an exception?

phronmophobic 2020-08-04T23:42:00.387900Z

it should

Rowan Barnard 2020-08-04T23:42:16.388400Z

Or at least print some message as to why it won't run

Rowan Barnard 2020-08-04T23:42:30.388900Z

I submit it and just nothing happens at all

phronmophobic 2020-08-04T23:43:11.390200Z

unfortunately, I'm not familiar with chlorine and rebl integration

Rowan Barnard 2020-08-04T23:43:27.390600Z

I thought Atom was hanging or I'd accidentally pressed something to make it switch to some other mode or something like that but when I type in other things it still submits and evaluates as normal

Rowan Barnard 2020-08-04T23:44:22.391700Z

Thanks for the input anyways phronmophobic 🙂

phronmophobic 2020-08-04T23:44:39.392Z

typing 05967 is a parse error, which might be treated differently than other types of errors

phronmophobic 2020-08-04T23:45:15.393100Z

maybe you'll get the same non-result if you type {(:1

Rowan Barnard 2020-08-04T23:45:17.393200Z

OK yes I just tried without leading zero

Rowan Barnard 2020-08-04T23:45:39.393700Z

It evaluates and throws exception for using count on a number

👍 1
Rowan Barnard 2020-08-04T23:45:45.393900Z

As expected

Rowan Barnard 2020-08-04T23:46:23.394900Z

Still I think there should be a message for using a leading zero?

Rowan Barnard 2020-08-04T23:46:48.395700Z

It seems not right to do absolutely nothing so maybe a bug?

phronmophobic 2020-08-04T23:47:17.396400Z

agreed. I wouldn't be surprised if the author just never noticed because they never tried to evaluate something that wouldn't parse

Rowan Barnard 2020-08-04T23:47:59.397500Z

OK

seancorfield 2020-08-04T23:48:09.397800Z

It doesn't work with the built in eval either -- not just via my wrapped eval.

Rowan Barnard 2020-08-04T23:48:39.398200Z

OK so is that a Chlorine bug then?

seancorfield 2020-08-04T23:49:36.399Z

I guess so. As @smith.adriane says, I suspect most of us have never noticed because we haven't tried to evaluate code that won't read.

seancorfield 2020-08-04T23:50:17.400Z

If you type that into a bare REPL, it can't even be read -- so it fails before evaluation.

seancorfield 2020-08-04T23:50:21.400300Z

user=> 05967
Syntax error reading source at (REPL:18:0).
Invalid number: 05967

Rowan Barnard 2020-08-04T23:50:22.400400Z

Ha ha yeah I guess only noobs like me find this stuff 😂

Rowan Barnard 2020-08-04T23:51:01.401200Z

OK but at least you get a message in the bare REPL

seancorfield 2020-08-04T23:51:40.402Z

In particular:

user=> (no-such-function 05967)
Syntax error reading source at (REPL:18:25).
Invalid number: 05967
Syntax error reading source at (REPL:18:26).
Unmatched delimiter: )
user=> 
note that it a) doesn't complain about no-such-function not existing and b) doesn't even read the closing ).

seancorfield 2020-08-04T23:52:57.403500Z

^ That's just to illustrate how early in the read-eval-print process it fails @flyingpython

mauricio.szabo 2020-08-04T23:53:14.404100Z

Hi, well, there are a few tests to fail unparseable code, but maybe something escaped :D

Rowan Barnard 2020-08-04T23:54:37.407100Z

OK thanks for the info, would be interesting to learn more about the different steps involved in the REPL process

mauricio.szabo 2020-08-04T23:54:46.407400Z

Can you open an issue with the code that's failing? Will look at it very soon :)

Rowan Barnard 2020-08-04T23:55:20.408100Z

OK cool will do! Can it wait for couple hours though? Just gotta whip out for some lunch 🙂

seancorfield 2020-08-04T23:56:11.408700Z

Don't worry, the bug will still be there when you get back! 🙂

😆 2
Rowan Barnard 2020-08-04T23:57:26.410600Z

Hang on, I'm entering bug now, still got some time