Giter Club home page Giter Club logo

Comments (7)

dharrigan avatar dharrigan commented on May 14, 2024 1

Hi,

This is my clojure deps.edn config, notice the :main-ops is not present:

  :rebl {:extra-deps {org.clojure/core.async {:mvn/version "RELEASE"}
                      org.clojure/data.csv {:mvn/version "RELEASE"}
                      org.clojure/data.json {:mvn/version "RELEASE"}
                      org.yaml/snakeyaml {:mvn/version "RELEASE"}
                      com.cognitect/rebl {:local/root "/home/david/development/workspaces/personal/clojure/rebl/rebl"}
                      org.openjfx/javafx-fxml     {:mvn/version "RELEASE"}
                      org.openjfx/javafx-controls {:mvn/version "RELEASE"}
                      org.openjfx/javafx-graphics {:mvn/version "RELEASE"}
                      org.openjfx/javafx-media    {:mvn/version "RELEASE"}
                      org.openjfx/javafx-swing    {:mvn/version "RELEASE"}
                      org.openjfx/javafx-base     {:mvn/version "RELEASE"}
                      org.openjfx/javafx-web      {:mvn/version "RELEASE"}}}

Then my conjure.edn config:

{:conns
 {:local
  {:port 55555}}
 :hooks
 {:connect! (fn [conn]
              (do (require 'cognitect.rebl)
                  ((resolve 'cognitect.rebl/ui))))
  :result! (fn [{:keys [code result]}]
             (cognitect.rebl/submit code result))}}

This works for me (once I'm in neovim, and I've connected to local and I eval an expression).

Hope that helps!

from conjure.

Olical avatar Olical commented on May 14, 2024 1

Going to close this since the whole concept of hooks has gone in the new update. I'll have to reassess how REBL can be hooked in but I suspect it would just be nREPL middleware which would be so cool. Conjure doesn't even have to know about it!

from conjure.

Olical avatar Olical commented on May 14, 2024

Ah, that'll probably do it! I don't think you want the :main-opts since that starts a REBL UI through some other thread potentially? Leaving it up to Conjure to start is probably for the best, if that solves your issue I think the caveat will need to go into the README.

The REBL docs are correct other than that one thing I guess? (in the context of using it with Conjure)

from conjure.

thecontinium avatar thecontinium commented on May 14, 2024

This setup works - thanks.
In the current readme

:result! (fn [{:keys [code result]}]
                           #?(:clj (cognitect.rebl/submit code result)))}}}}

does not work for me.

This does:

:result! (fn [{:keys [code result]}]
             (cognitect.rebl/submit code result))}}

from conjure.

thecontinium avatar thecontinium commented on May 14, 2024

If I execute this:

(defn fib [x]
  (loop [n x result '(1 0)]
    (if (> n 1)
      (recur (- n 1) (conj result (+ (first result) (first (rest result)))))
      (rest (reverse result))
      )))

it has output in the REBL.
Followed by: (fib 10) gives no output to the REBL.

Can you see any reason for this ?

cheers

from conjure.

Olical avatar Olical commented on May 14, 2024

Hmm, the reader conditional not working isn't great, I'll need to check that out. Really I don't need to recommend it since one conn is one language. I was mainly using reader conditionals in testing when I had the hooks at the top level so every connection got REBL if it was Clojure.

A fun experiment but not really a common use case.

With regards to the fib call: I'm really not sure... maybe lazy sequences aren't rendering correctly? I'll try to have a look soon. This issue will remain open until:

  • Documentation updated to show a minimal working REBL scenario.
  • Reader conditionals in hooks investigated. (I think some hooks will work, others won't depending on your current file name ending in .cljc or not.)
  • Your fib example is working.

from conjure.

thecontinium avatar thecontinium commented on May 14, 2024

from conjure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.