Skip to content

Commit d352af0

Browse files
committed
CHANGE: renamed module's local context from local-lib to lib-local
So it is consistent with existing `lib-base` and `lib-file`, which are also there. Related to: Oldes/Rebol-wishes#13
1 parent 500d3da commit d352af0

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/mezz/sys-base.reb

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ make-module*: func [
132132
if find spec/options 'extension [
133133
append obj 'lib-base ; specific runtime values MUST BE FIRST
134134
]
135-
append obj 'local-lib ; local import library for the module
135+
append obj 'lib-local ; local import library for the module
136136

137137
unless spec/type [spec/type: 'module] ; in case not set earlier
138138

@@ -184,7 +184,7 @@ make-module*: func [
184184
]
185185

186186
bind body obj
187-
obj/local-lib: any [mixins make object! 0] ; always set, always overrides
187+
obj/lib-local: any [mixins make object! 0] ; always set, always overrides
188188
if block? hidden [protect/hide/words hidden]
189189
obj: to module! reduce [spec obj]
190190
do body

src/mezz/sys-start.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ start: func [
138138

139139
;-- Make the user's global context:
140140
tmp: make object! 320
141-
append tmp reduce ['system :system 'local-lib :tmp]
141+
append tmp reduce ['system :system 'lib-local :tmp]
142142
system/contexts/user: tmp
143143

144144
boot-print ["Checking for user.reb file in" home]

src/tests/units/module-test.r3

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ supplement system/options/module-paths join what-dir %units/files/
1717
--test-- "hidden"
1818
;@@ https://github.com/Oldes/Rebol-issues/issues/1696
1919
--assert all [
20-
[local-lib a] = words-of m: module [] [a: 1]
20+
[lib-local a] = words-of m: module [] [a: 1]
2121
m/a = 1
2222
]
2323
--assert all [
24-
[local-lib b] = words-of m: module [] [hidden a: 1 b: does[a + 1]]
24+
[lib-local b] = words-of m: module [] [hidden a: 1 b: does[a + 1]]
2525
error? try [m/a]
2626
m/b = 2
2727
]
@@ -283,8 +283,8 @@ probe all [
283283
--assert module? m: try [import/version m-1687 1.0.0]
284284
--assert all [
285285
;@@ https://github.com/Oldes/Rebol-wishes/issues/13
286-
object? m/local-lib
287-
empty? m/local-lib ; because there was no import in this module
286+
object? m/lib-local
287+
empty? m/lib-local ; because there was no import in this module
288288
]
289289

290290
--test-- "import/check"
@@ -324,8 +324,8 @@ probe all [
324324
--assert true? test-needs-file-result
325325
--assert all [
326326
;@@ https://github.com/Oldes/Rebol-wishes/issues/13
327-
object? m/local-lib
328-
m/local-lib/test-needs-file-value = 42 ; value imported from the inner module
327+
object? m/lib-local
328+
m/lib-local/test-needs-file-value = 42 ; value imported from the inner module
329329
]
330330

331331
--test-- "import needs url!"
@@ -334,9 +334,9 @@ probe all [
334334
--assert true? test-needs-url-result
335335
]
336336

337-
--test-- "local-lib"
337+
--test-- "lib-local"
338338
;@@ https://github.com/Oldes/Rebol-wishes/issues/13
339-
--assert same? local-lib system/contexts/user
339+
--assert same? lib-local system/contexts/user
340340

341341
--test-- "do module from file"
342342
;@@ https://github.com/Oldes/Rebol-issues/issues/1203
@@ -353,12 +353,12 @@ probe all [
353353
--test-- "issue-1005"
354354
;@@ https://github.com/Oldes/Rebol-issues/issues/1005
355355
m: module [] [a: 1 2]
356-
--assert [local-lib: #[object![]] a: 1] = body-of m
357-
--assert [local-lib a] = keys-of m
356+
--assert [lib-local: #[object![]] a: 1] = body-of m
357+
--assert [lib-local a] = keys-of m
358358
--assert [#[object![]] 1] = values-of m
359359
m: module [exports: [a]] [a: 1 2]
360-
--assert [local-lib: #[object![]] a: 1] = body-of m
361-
--assert [local-lib a] = keys-of m
360+
--assert [lib-local: #[object![]] a: 1] = body-of m
361+
--assert [lib-local a] = keys-of m
362362
--assert [#[object![]] 1] = values-of m
363363

364364
--test-- "issue-1708"

0 commit comments

Comments
 (0)