diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-07-15 16:42:53 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-07-15 16:42:53 -0400 |
| commit | af7af923366fe116019e50785e56def172a6a1ab (patch) | |
| tree | bd5facb3ac707fb8ee0f0d261f4d601accff9ede | |
| parent | c3bb2309bdfd8598a2c71fa66c95543fb70ca9c1 (diff) | |
Change •file.At to not resolve 𝕨 in JS and spec, matching CBQN
| -rwxr-xr-x | bqn.js | 4 | ||||
| -rw-r--r-- | docs/spec/system.html | 2 | ||||
| -rwxr-xr-x | gendocs | 2 | ||||
| -rw-r--r-- | spec/system.md | 2 |
4 files changed, 5 insertions, 5 deletions
@@ -44,8 +44,8 @@ sysvals.file = dynsys(state => { // Paths and parsing path: p, at: (x,w) => { - let e="•file.At", f=res(e)(has(w)?w:x); - return str(has(w)?path.resolve(f,req1str(e,x)):f); + let e="•file.At"; + return str(has(w)?path.join(req1str(e,w),req1str(e,x)):res(e)(x)); }, name: (x,w) => str(path.basename(req1str("•file.Name",x,w))), extension: (x,w) => str(path.extname (req1str("•file.Extension",x,w))), diff --git a/docs/spec/system.html b/docs/spec/system.html index 67af11c2..fadf914b 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -176,7 +176,7 @@ </tr> <tr> <td><code><span class='Function'>At</span></code></td> -<td>Absolute path of file, with optional base <code><span class='Value'>𝕨</span></code></td> +<td>Join base path <code><span class='Value'>𝕨</span></code>, or <code><span class='Value'>•path</span></code> if not given, to <code><span class='Value'>𝕩</span></code></td> </tr> <tr> <td><code><span class='Function'>Name</span></code></td> @@ -6,6 +6,6 @@ files ← { 0<≠•args ? •args ; # All markdown files in directories corresponding to ones in docs/ At‿List‿Type ← •file SubDirs ← { 𝕩 <⊸∾ ∾ 𝕊¨ ('d'=Type¨)⊸/ 𝕩⊸At¨ List 𝕩 } - ∾ (<At¨·(".md"≡¯3⊸↑)¨⊸/List)¨ (≠↓¨SubDirs) At "docs/" + ∾ (<At¨·(".md"≡¯3⊸↑)¨⊸/List)¨ (≠↓¨SubDirs) "docs/" } files •Import "md.bqn" diff --git a/spec/system.md b/spec/system.md index 65cd722d..f43e20f4 100644 --- a/spec/system.md +++ b/spec/system.md @@ -83,7 +83,7 @@ The following functions manipulate paths and don't access files. Each takes a re | Name | Summary |-------------|-------------------------- | `path` | Path of this source file, that is, `•path` -| `At` | Absolute path of file, with optional base `𝕨` +| `At` | Join base path `𝕨`, or `•path` if not given, to `𝕩` | `Name` | File name including extension | `Parent` | Path of the containing directory, with trailing backslash | `BaseName` | File name, with dot and extension removed |
