mirror of
https://github.com/anoma/juvix.git
synced 2024-12-15 01:52:11 +03:00
6894300e5a
This PR adds support for importing modules from within a Juvix project in the Juvix REPL. The imported module is checked (parsed, arity-checked, type-checked etc) as normal and added to the REPL session scope. Any errors during the checking phase is reported to the user. ### Notes: * You must load a file before using `import`. This is because the REPL needs to know which Juvix project is active. * You may only import modules from within the same Juvix project. ### Examples After launching `juvix repl`: #### `open import` ``` Stdlib.Prelude> open import Stdlib.Data.Int.Ord Stdlib.Prelude> 1 == 1 true ``` #### `import as` ``` Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int Stdlib.Prelude> 1 Int.== 1 true ``` #### `import`then `open` ``` Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int Stdlib.Prelude> open Int Stdlib.Prelude> 1 == 1 true ``` #### Line-terminating semicolons are ignored: ``` Stdlib.Prelude> import Stdlib.Data.Int.Ord as Int;;;;; Stdlib.Prelude> 1 Int.== 1 true ``` * Closes https://github.com/anoma/juvix/issues/1951 --------- Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no> |
||
---|---|---|
.. | ||
265 | ||
272 | ||
BuiltinsMultiImport | ||
BuiltinsMultiOpenImport | ||
Dependencies | ||
FancyPaths | ||
Imports | ||
ImportShadow | ||
Internal | ||
issue1333 | ||
issue1466 | ||
issue1693 | ||
issue1731 | ||
issue1879 | ||
NoDependencies | ||
QualifiedConstructor | ||
QualifiedImports | ||
QualifiedSymbol | ||
QualifiedSymbol2 | ||
Reachability | ||
StdlibImport | ||
StdlibList | ||
Termination | ||
Ape.juvix | ||
Axiom.juvix | ||
Builtins.juvix | ||
BuiltinsBool.juvix | ||
Format.juvix | ||
Inductive.juvix | ||
InductivePipes.juvix | ||
Judoc.juvix | ||
juvix.yaml | ||
LetShadow.juvix | ||
Literals.juvix | ||
MultiParams.juvix | ||
MutualLet.juvix | ||
NestedPatterns.juvix | ||
Operators.juvix | ||
Parsing.juvix | ||
Polymorphism.juvix | ||
PolymorphismHoles.juvix | ||
Pragmas.juvix | ||
ShadowPublicOpen.juvix | ||
SignatureWithBody.juvix | ||
Symbols.juvix | ||
TypeAlias.juvix |