Skip to content

Commit db11dcb

Browse files
committed
update use declarations
1 parent 9d88a09 commit db11dcb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/packages/using-packages.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ Import paths is data used to import packages. It is written between double quote
1313

1414
For a path to be valid, it must comply with some rules:
1515
- Cannot contain `_`. So `_/...`, `.../_/...` or `.../_` are invalid.
16+
- Cannot contain path control runes (`.` or `..`). So `foo/./bar`, `foo/../../baz` or `foo/.` are invalid.
1617
- Each subpackage is separated from each other by the `/` character. There cannot be an empty distinction, so `//` is invalid. Cannot start or end with `/` also.
1718

1819
Jule processes these import paths accordingly and reads the packages by converting them to the file system path.
1920

2021
### Standard Library
2122

22-
To import standard library packages, the import path must start with `std/...`. Any package that starts this way is considered a standard library package.
23+
To import standard library packages, the import path must start with `std/`. Any package that starts this way is considered a standard library package.
2324

2425
For example:
2526
- `std/conv`
@@ -40,10 +41,8 @@ head/
4041
│ ├─ bar/
4142
│ │ ├─ README.md
4243
│ │ └─ bar.jule
43-
│ │
4444
│ ├─ README.md
4545
│ └─ foo.jule
46-
4746
├─ jule.mod
4847
├─ LICENSE
4948
└─ main.jule
@@ -52,8 +51,8 @@ As you can see in your project tree, your main package `head` directory has `foo
5251

5352
Using your subpackages is simple, here is an example:
5453
```jule
55-
use "foo"
56-
use "foo/bar"
54+
use "head/foo"
55+
use "head/foo/bar"
5756
```
5857
As you can see in the example above, each subpackage in your main package represents a chain of packages that you can use. This means that in your subpackages you will follow the same syntax when you try to use your other subpackages. The packages you can import start from your main module, where your module file is located.
5958

@@ -80,7 +79,6 @@ For example, some import paths and their parts used as alias:
8079
- `bar/foo`: `foo`
8180
- `foo/bar/baz`: `baz`
8281
- `foo/_bar_`: `_bar_`
83-
- `foo/123`: `123`
8482

8583
When processing an alias automatically, some rules are observed. For example, the namespace must be a valid identifier. Therefore, if the final package representation does not provide a valid alias identifier, your compiler will prompt you to manually assign a valid one.
8684

0 commit comments

Comments
 (0)