Giter Club home page Giter Club logo

Comments (14)

Olical avatar Olical commented on May 15, 2024 1

Ah damn, I'm sorry about that 😭 try pouring it into a map or bean, it might get around the printing temporarily. I'm still waiting on my patch going into ClojureScript, maybe I can do a halfway house soon to fix the Clojure side at least.

Once that CLJS patch is in I won't have to parse anything returned from the prepl which will make things a lot easier. I'll see what I can do to mitigate it until the proper fixes are possible 🤔

from conjure.

Olical avatar Olical commented on May 15, 2024

Patch released in v0.17.1 to mitigate this, it'll show you the parse error and not kill the connection. Full fix will come with the errors / exceptions rework I think..

from conjure.

Olical avatar Olical commented on May 15, 2024

Error improvement work is now waiting for this patch to go into ClojureScript https://clojure.atlassian.net/browse/CLJS-3096

Once that's in I can rewrite how the error handling system works which means I don't need to parse output from prepl evaluations which means this error will vanish. This will make Conjure a lot more robust too, right now there's a few cases where returning something out of the ordinary will cause it to choke.

If you hit one of these errors, I'm really sorry. You'll just have to pour the data into Clojure data structures or use bean until this is patched, hopefully it won't be too long!

from conjure.

justone avatar justone commented on May 15, 2024

I think I'm running into this with Manifold streams. They have a custom print-method that returns this:

<< stream: {:pending-puts 0, :drained? false, :buffer-size 0, :permanent? false, :type "manifold", :sink? true, :closed? false, :pending-takes 0, :buffer-capacity 0, :source? true} >>

and causes Conjure to report "Invalid symbol: stream:.".

No rush, just wanted to add another data point.

Thanks for making Conjure, I enjoy using it every day.

from conjure.

daveyarwood avatar daveyarwood commented on May 15, 2024

I'm also being hit by this in a project I'm working on.

I did find a workaround: if you find yourself needing to evaluate a form where you know the result is a record, you can wrap it with (into {} the-form) This turns the record into a plain map.

There is still a problem if you want to evaluate a form that contains records (e.g. a map where the values include records). I found a solution for this on StackOverflow: (clojure.walk/postwalk #(if (record? %) (into {} %) %) the-form)

It's not ideal, but I think it will tide me over until a fix comes down the pike :)

from conjure.

Olical avatar Olical commented on May 15, 2024

I've got an idea for how I could potentially work around this until ClojureScript prepl hits feature parity with Clojure prepl 🤔 I'll see what I can do ASAP, just got talk planning to do for next Wednesday.

from conjure.

Olical avatar Olical commented on May 15, 2024

Testing Slack integration...

from conjure.

justone avatar justone commented on May 15, 2024

@daveyarwood great idea to use clojure.walk. Here's my augmented version that handles manifold streams:

(defn nr
  [form]
  (clojure.walk/postwalk
    #(cond
       (record? %) (into {} %)
       ((supers (class %)) manifold.stream.core.IEventStream) (pr-str %)
       :else %)
    form))

from conjure.

Olical avatar Olical commented on May 15, 2024

So when someone who's experienced this has some free time, would you be able to try it again but on the result-refactor branch? #47

I'll try to repro too, but it would be great if you could try to do exactly what you did before that caused Conjure to explode. I'm hoping my changes have fixed it, if not I think a slight tweak will be all that's needed after that refactor work.

Thanks a lot!

from conjure.

daveyarwood avatar daveyarwood commented on May 15, 2024

A simple repro case is to evaluate the following using your project's prepl:

;; this works because the return value is the var `my-namespace.Foo`
(defrecord Foo [])

;; this blows up because the return value is a record
(->Foo)

from conjure.

daveyarwood avatar daveyarwood commented on May 15, 2024

I just tried the result-refactor branch, and the issue appears to be fixed!

2019-07-04-162212_322x45_scrot

I also tried it out on the work project where I ran into this issue before, and it's fixed there too 👍

from conjure.

Olical avatar Olical commented on May 15, 2024

Yessss, thank you for checking, that's great news. I'll wrap up the rest of that PR and get it out in a tagged release.

from conjure.

justone avatar justone commented on May 15, 2024

The issue is fixed for me as well. Thanks!

from conjure.

Olical avatar Olical commented on May 15, 2024

So this is fixed in v0.21.0 😄

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.