Giter VIP home page Giter VIP logo

Comments (2)

Arjuna144 avatar Arjuna144 commented on May 21, 2024

My bad, I found my errors!

from lux.

 avatar commented on May 21, 2024

Hi, @Arjuna144

I am still using luxc3.1.jar since I am getting the following error with luxc.3.2.jar and the following

There were some important changes to Lux as a language in v0.3.2 that cause the v0.3.1 stdlib to not compile (which was probably the error you got, since I see the _lux_def form you showed there lacks meta-data, which was a v0.3.2 addition).

I'm waiting until I'm done with v0.3.3 to document those changes, since some stuff requires a bit more polishing (I fixed a bug with tuples and I'm working on fixing one with variants, both of which were introduced in a major change during v0.3.2).

I've also abstained from talking about JVM interop because I'm still adding a bit more features on that front, plus polishing what's already there, since it's usable, but not terribly comfortable as of v0.3.2 (importing them is great, but defining new classes is still somewhat of a hassle).

Anyway... regarding the infinite loop!
You didn't post the error, so I can only speculate, but I'm aware of a stack-overflow error that sometimes happens in the type-checking phase that gets solved by just adding a bit more type annotations.
I imagine you got that one and fixed it in that way.

By the way, when you define this:

(def (echo)
  (IO (,))
  (>>= IO/Monad read-line tellWhat))

You don't need to put echo in parentheses. You can, if you want, but it's not mandatory.

The parentheses syntax on def is just there as a convenience to save people from having to add an extra lambda form.

Consider this:

(def (>>= m ma f)
  (All [m a b]
    (-> (Monad m) (m a) (-> a (m b)) (m b)))
  (using m
    (join (map f ma))))

Versus this:

(def >>=
  (All [m a b]
    (-> (Monad m) (m a) (-> a (m b)) (m b)))
  (lambda [m ma f]
    (using m
      (join (map f ma)))))

Oh... and remember that to run a program you need a (program args ...) form, which is basically your "main" method.

from lux.

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.