calysto_hy icon indicating copy to clipboard operation
calysto_hy copied to clipboard

added support for hy 0.24.0 + new fallback completer

Open fergusq opened this issue 3 years ago • 4 comments

Added support for the latest release of hy and a new fallback completer. Since Jedhy doesn't support hy 0.24.0, it's still unusable.

fergusq avatar Nov 01 '22 12:11 fergusq

Thanks for this! Does the setup.py need any changes as to version or other dependencies?

dsblank avatar Nov 01 '22 14:11 dsblank

Other than updating the calysto_hy version number, I don't think other changes are needed. I tested it and it worked without any changes to dependencies.

The example notebooks have obsolete syntax like (, a b) instead of #(a b). I pushed some changes to fix the other notebook, but the other would have to be copied again from the Hy tutorial.

I also changed set_variable and get_variable so that they change self.module and not self.env since module is what is given to the Hy compiler.

fergusq avatar Nov 01 '22 15:11 fergusq

And one thing: I changed it so that only the value of the last form in the cell is shown in the notebook, not a list with all of the values. This matches how the Python kernel works.

fergusq avatar Nov 01 '22 15:11 fergusq

Great! Thanks for the additional info. I'll try this out.

dsblank avatar Nov 01 '22 17:11 dsblank

At least for me, macros don't work.

Screen Shot 2022-11-30 at 11 01 18 AM

but thank you SO much for tackling this. The lack of updates to Calysto Hy has been the source of much frustration.

actsasgeek avatar Nov 30 '22 16:11 actsasgeek

I think you mistyped (t [1, 2, 3]) as t([1, 2, 3]). It should work if you call the macro instead of just referring to its name.

fergusq avatar Nov 30 '22 16:11 fergusq

Oh, that was silly. I confused myself because I was trying to fix the reader macros in jedhy. D'oh! Thanks. That does work!

actsasgeek avatar Nov 30 '22 20:11 actsasgeek

As I don't have an original version around, I'm not sure if this worked before. However, calysto hy and the hy repl give different results for evaluating expressions:

=> (+ '(1 2) '(kim fred))
'(1 2 kim fred)

versus

Screen Shot 2022-12-07 at 3 54 48 PM

Not sure if this is a "bug" with the update/revision or not... :/

actsasgeek avatar Dec 07 '22 20:12 actsasgeek

I don't think that was caused by my edits, but it's easily fixed. Metakernel can be configured to use a custom repr function, I should change it to use hy.repl.

fergusq avatar Dec 08 '22 10:12 fergusq

what versions of jupyter are you using? wouldn't be bad to add a requirements.txt with their versions broken... will file a bug right now for that

vrescobar avatar Apr 01 '23 11:04 vrescobar

Could I ask one more addition: can you increment the version number? If all looks good, I'll merge. Also, if anyone is interested in helping maintain this repo, let us know!

dsblank avatar Jun 22 '23 13:06 dsblank

I increased the version number to 0.2.0.

fergusq avatar Jul 13 '23 12:07 fergusq

Thanks all!

dsblank avatar Jul 13 '23 13:07 dsblank