chlorine-clover 2021-05-11

now I see there is something going to be connect! in https://github.com/mauricioszabo/atom-chlorine/issues/94 . Sorry about that

is 0.11.2 available?

Not yet, just waiting for the CI to run

with this, I think I can manage many repls as I want, thank you

yes, but you still can only be connected in one at a time, but at least it's easier to switch between them

is it will take too long? ๐Ÿ™‚

It's published now

ahahahahaha, I saw it now ๐Ÿ˜ฑ

Iยดm checking it now

why didnยดt you expose the disconnect?

my happiness took only 5 minutes ๐Ÿ˜ž

Because you can run it without needing to be exposed

atom.commands.dispatch(atom.views.getView(atom.workspace.getActiveTextEditor()), 'chlorine:disconnect')

(replace 'chlorine:disconnect' or any other command from Chlorine or any other package)

# This waits for the package to load
atom.packages.activatePackage('chlorine').then (pkg) ->
  # This picks up the "main module" of the package
  Cl = pkg.mainModule
  
  # Conectar sem pop-up
  atom.commands.add 'atom-text-editor', 'fabrao:connect-direct', ->
    editor = atom.workspace.getActiveTextEditor()
    atom.commands.dispatch(atom.views.getView(editor), 'chlorine:disconnect')
  	Cl.connect_socket 'localhost', 5555
What am I doing wrong?

What's happening, exactly? Some error, or the command does not appear on the command pallete?

Cl is not defined -> after evaluate , but if I run it, only disconnect, not connect

is it an async process?

BTW, I think all commands on Atom are async, so you may have to await a little bit for everything to get settled up. Maybe something like:

atom.packages.activatePackage('chlorine').then (pkg) ->
  # This picks up the "main module" of the package
  Cl = pkg.mainModule
  # Conectar sem pop-up
  atom.commands.add 'atom-text-editor', 'chlo:connect-direct', () ->
    editor = atom.workspace.getActiveTextEditor()
    atom.commands.dispatch(atom.views.getView(editor), 'chlorine:disconnect')
    setTimeout(
        -> Cl.connect_socket 'localhost', 5555
      , 200
    )

(I have no idea if the setTimeout syntax is right... too much time without having to handle coffeescript, thankfully)

Fixed the syntax

I was trying to fix it

is it worked for you?

Ok, did another fix on the script. the -> needs an extra space so setTimeout will undestand that 200 is the second parameter, and not part of Cl.connect

BTW, I highly suggest you to rename your init.coffee to init.js and use Javascript only... CoffeeScript is terrible because of these small issues

I was certainly very happy to remove as much of my init.coffee as possible and switch over to the config.cljs that Chlorine uses for customization ๐Ÿ™‚

is that possible to use all those scripts in config.cljs?

hi I am "r" ๐Ÿ™‚

๐Ÿ‘‹ 2

@fabrao not really. config.cljs is mostly a way to configure evaluations results and other things. It relies on some state that only exist when you're connected to a REPL, so that's why it's not (yet) possible ๐Ÿ™‚

@m373h4n we were talking about clojerl over the meetup. I think that the latest version of Clojerl (0.7.0) have a bug on the Socket REPL implementation, so you may want to use the master branch. If you use rebar3 to start your Clojerl project there's a config to use the branch instead of the version

thank you for the tip I'll use the master branch ๐Ÿบ๐Ÿ™‚

Nice, any problems ping me ๐Ÿ™‚.

ofc I'll ๐Ÿ™‚ very nice beard btw I like it ๐Ÿ˜„

๐Ÿคฃ 1