Skip to content

Commit 053f84e

Browse files
committed
CHANGE: necessary changes related to having import's module argument not evaluated
1 parent bd09ce0 commit 053f84e

File tree

5 files changed

+39
-32
lines changed

5 files changed

+39
-32
lines changed

make/tools/make-boot.reb

+24-20
Original file line numberDiff line numberDiff line change
@@ -933,16 +933,18 @@ foreach section [boot-base boot-sys boot-mezz] [
933933
)
934934
]
935935
][
936-
compose/deep/only [
937-
import module [
938-
Title: (select hdr 'title)
939-
Name: (select hdr 'name)
940-
Version: (select hdr 'version)
941-
Date: (select hdr 'date)
942-
Author: (select hdr 'author)
943-
Exports: (select hdr 'exports)
944-
Needs: (select hdr 'needs)
945-
] ( code )
936+
reduce [
937+
'import to paren! compose/deep/only [
938+
module [
939+
Title: (select hdr 'title)
940+
Name: (select hdr 'name)
941+
Version: (select hdr 'version)
942+
Date: (select hdr 'date)
943+
Author: (select hdr 'author)
944+
Exports: (select hdr 'exports)
945+
Needs: (select hdr 'needs)
946+
] ( code )
947+
]
946948
]
947949
]
948950
][ code ]
@@ -984,16 +986,18 @@ foreach file first mezz-files [
984986
)
985987
]
986988
][
987-
compose/deep/only [
988-
import module [
989-
Title: (select hdr 'title)
990-
Name: (select hdr 'name)
991-
Version: (select hdr 'version)
992-
Date: (select hdr 'date)
993-
Author: (select hdr 'author)
994-
Exports: (select hdr 'exports)
995-
Needs: (select hdr 'needs)
996-
] ( code )
989+
reduce [
990+
'import to paren! compose/deep/only [
991+
module [
992+
Title: (select hdr 'title)
993+
Name: (select hdr 'name)
994+
Version: (select hdr 'version)
995+
Date: (select hdr 'date)
996+
Author: (select hdr 'author)
997+
Exports: (select hdr 'exports)
998+
Needs: (select hdr 'needs)
999+
] ( code )
1000+
]
9971001
]
9981002
]
9991003
][

make/tools/make-host-init.reb

+9-8
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@ load-files: func [
9595
header: file/1
9696
remove file
9797
if header/type = 'module [
98-
file: compose/deep [
99-
import module
100-
[
101-
title: (header/title)
102-
version: (header/version)
103-
name: (header/name)
104-
][
105-
(file)
98+
file: reduce [
99+
'import to paren! compose/deep[
100+
module [
101+
title: (header/title)
102+
version: (header/version)
103+
name: (header/name)
104+
][
105+
(file)
106+
]
106107
]
107108
]
108109
;probe file/2

src/mezz/mezz-help.reb

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ REBOL [
1212
}
1313
]
1414

15-
import module [
15+
import (module [
1616
Title: "Help related functions"
1717
Name: help
1818
Version: 3.0.0
@@ -550,7 +550,7 @@ import module [
550550
]
551551
exit
552552
]
553-
]
553+
])
554554

555555
;-- old alpha functions:
556556
;pending: does [

src/mezz/sys-load.reb

+3-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ download-extension: function[
713713

714714
import: function [
715715
"Imports a module; locate, load, make, and setup its bindings."
716-
'module [word! file! url! string! binary! module! block!]
716+
'module [any-word! file! url! string! binary! module! block!]
717717
/version ver [tuple!] "Module must be this version or greater"
718718
/check sum [binary!] "Match checksum (must be set in header)"
719719
/no-share "Force module to use its own non-shared global namespace"
@@ -728,6 +728,8 @@ import: function [
728728
]
729729
; Note: IMPORT block! returns a block of all the modules imported.
730730

731+
if any-word? module [module: to word! module]
732+
731733
; Try to load and check the module.
732734
set [name: mod:] apply :load-module [module version ver check sum no-share no-lib /import]
733735

src/mezz/sys-start.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ start: func [
200200
;if :lib/secure [protect-system-object]
201201

202202
; Import module?
203-
if import [lib/import import]
203+
if import [lib/import :import]
204204

205205
;-- Evaluate: --do "some code" if found
206206
if do-arg [

0 commit comments

Comments
 (0)