Code Monkey home page Code Monkey logo

Comments (5)

rktjmp avatar rktjmp commented on May 27, 2024 1

It needs to go in the modules (and optionally macros) table, the option name is useBitLib per https://fennel-lang.org/reference.

These all work as you would expect, with a few caveats. The bitwise operators are only available in Lua 5.3+, unless you use the --use-bit-lib flag or the useBitLib flag in the options table, which lets them be used in LuaJIT. The integer division operator (//) is only available in Lua 5.3+.

modules = {
  correlate = true,
  useBitLib = true,
},

You might have to touch/save/edit files that you want to use the bit operators in to trigger a recompile with the new options.

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

I don't disagree that it could be enabled by default, but I am hesitant to do it because it isn't a complete compatibility layer: "The integer division operator (//) is only available in Lua 5.3+" and they "cannot be used as higher-order functions".

I think that puts some onus on the user to know what they want to use and how they can use it so it should probably be opt in.

from hotpot.nvim.

otommod avatar otommod commented on May 27, 2024

I was just reading the Fennel reference and saw that passage. I guess useBitLib is documented after all.

cannot be used as higher-order functions

That's always true though, LuaJIT or not.

The integer division operator (//) is only available in Lua 5.3+

There is, indeed, nothing that can be done in this case.

Still, not using the option is definitely the less correct solution for Neovim (at least so long as LuaJIT is the only supported implementation).

from hotpot.nvim.

reptee avatar reptee commented on May 27, 2024

Hello!

Seeing this issue and fennel's supports for bitlib, how do I enable it within hotpot?
fennel.compile doesn't seem to take any related options and passing any of "--use-bit-lib", "use-bit-lib" to hotpotConfig.compiler table doesn't provide support for it

require("hotpot").setup {
  provide_require_fennel = true,
  enable_hotpot_diagnostics = true,
  compiler = {
    ["--use-bit-lib"] = true,
    ["use-bit-lib"] = true,
    "--use-bit-lib",
    "use-bit-lib",
    modules = {
      correlate = true,
    },
  },
}

from hotpot.nvim.

reptee avatar reptee commented on May 27, 2024

Many thanks

from hotpot.nvim.

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.