Code Monkey home page Code Monkey logo

Comments (2)

sogaiu avatar sogaiu commented on July 17, 2024 1

Although there is mention of init.janet at https://janet-lang.org/docs/modules.html, reading the text there didn't lead me to deduce the current behavior.

For reference, I think a relevant line of source in boot.janet is this one:

(module/add-paths "/init.janet" :source)

May be this section of the website docs would be a good place to mention behavior with respect to init.janet.

from janet-lang.org.

sogaiu avatar sogaiu commented on July 17, 2024 1

If something is going to be added to the website docs about /init.janet, may be it makes sense to mention the other items that are searched for (and the order as well).

IIUC, for (import foo), at least four things might be looked for in the following order:

  1. foo.jimage
  2. foo.janet
  3. foo/init.janet
  4. foo.<native-extension>

(Here, <native-extension> is likely to be .so on a Linux machine or .dll on Windows.)

I think the search is done in the above order and the first match "wins". That is, once a match is found, the search ends and an attempt is made to "import" the matched item.

For reference, here are some relevant-looking lines from boot.janet.

from janet-lang.org.

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.