E.g.
(import project/file.janet :as file)
(import ./project/file.janet :as file)
(import /home/me/project/file.janet :as file)
Will now do what you expect. When loading with a file extension, this
will first check directly if the relative (or absolute) path exists.
Also expands `module/find` to be able to show all matches for a given
module name without needing to try and catch import errors. Lastly, one
can also override the module/find functionality by passing `:loader`
directly.
E.g.
(import ./macoslib.dylib :loader :native :as my-thing)
Which will allow easily bypassing all module/find logic;
"./macoslib.dylib" will be passed directly to the :native loader
`(get module/loaders :native)`.
The module system was previously left open to customization but with
defaults to encourage a more typical style. However, these qol
improvements are more than worth it and can in some cases let people
stop fighting the module system.
Macro expansion as done by `macex1` was incorrectly losing the semantic
tuple information inside the `set` form. Since macro expansion is
usually done by the compiler, and `macex1` is mainly used for debugging
and deep transformations inside other macros, this only surfaced with
certain usage of short-fn macro.
The macro would previously choke on `(varfn abc {:abc 123} ...)` due
to mishandling of structs and tables as metadata. This caused issues
when running `janet -d` with spork.
Instead of manually putting bindings into environment tables, just use
`setdyn` to set the bindings based on the command line flags. This
results in easier to understand behavior and prevents "swallowing" of
options. For example, linting and debug flags should be set in the
root-env by default so that they are used in all loaded modules.
This does create a lot of warnings, especially in the test suite, but
should improve code and point out real issues.
To disable individual messages, either disable linting, add the metadata :unused to a
binding, or add the prefix "_" to a symbol.
* Add `thaw-keep-keys` variant of `thaw`.
* Add `walk2` to traverse key-value pairs and fibers. Also add
corresponding `postwalk2` and `prewalk2`
* Built-in `repl` function now respects custom repl prompt.
Allow re-using the same symbol for the fiber and error. This allows you to
write code like (try (print "hi") ([_ _] (print "oh no"))), fixing a regression
introduced in #1605.
This is a companion change to spork's issue
As implemented, :has-been-script didn't quite
mean what was intended. :has-exe should
be an improvement.
To prevent breakage, both :has-bin-script and
:has-exe should be supported for a while in
both spork and janet. Eventually
:has-bin-script can be retired.