Skip to content

Commit d19b885

Browse files
committed
CHANGE: replaced load/type with load/as
1 parent bcb875a commit d19b885

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/mezz/sys-base.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ do*: func [
4646
; Currently, load of URL has no special block forms.
4747

4848
; Load the data, first so it will error before change-dir
49-
data: load/header/type value 'unbound ; unbound so DO-NEEDS runs before INTERN
49+
data: load/header/as value 'unbound ; unbound so DO-NEEDS runs before INTERN
5050
; Get the header and advance 'data to the code position
5151
hdr: first+ data ; object or none
5252
; data is a block! here, with the header object in the first position back

src/mezz/sys-load.reb

+16-16
Original file line numberDiff line numberDiff line change
@@ -281,22 +281,22 @@ load: function [
281281
source [file! url! string! binary! block!] {Source or block of sources}
282282
/header {Result includes REBOL header object (preempts /all)}
283283
/all {Load all values (does not evaluate REBOL header)}
284-
/type {Override default file-type; use NONE to always load as code}
285-
ftype [word! none!] "E.g. text, markup, jpeg, unbound, etc."
284+
/as {Override default file-type; use NONE to always load as code}
285+
type [word! none!] "E.g. text, markup, jpeg, unbound, etc."
286286
] [
287287
; WATCH OUT: for ALL and NEXT words! They are local.
288288

289289
; NOTES:
290290
; Note that code/data can be embedded in other datatypes, including
291291
; not just text, but any binary data, including images, etc. The type
292292
; argument can be used to control how the raw source is converted.
293-
; Pass a /type of none or 'unbound if you want embedded code or data.
293+
; Pass a /as of none or 'unbound if you want embedded code or data.
294294
; Scripts are normally bound to the user context, but no binding will
295-
; happen for a module or if the /type is 'unbound. This allows the result
295+
; happen for a module or if the /as is 'unbound. This allows the result
296296
; to be handled properly by DO (keeping it out of user context.)
297297
; Extensions will still be loaded properly if /type is 'unbound.
298298
; Note that IMPORT has its own loader, and does not use LOAD directly.
299-
; /type with anything other than 'extension disables extension loading.
299+
; /as with anything other than 'extension disables extension loading.
300300

301301
assert/type [local none!] ; easiest way to protect against /local hacks
302302

@@ -305,23 +305,23 @@ load: function [
305305

306306
;-- Load multiple sources?
307307
block? source [
308-
return map-each item source [apply :load [:item header all type ftype]]
308+
return map-each item source [apply :load [:item header all as type]]
309309
]
310310

311311
;-- What type of file? Decode it too:
312312
any [file? source url? source] [
313-
sftype: file-type? source
314-
ftype: case [
315-
lib/all ['unbound = ftype 'extension = sftype] [sftype]
316-
type [ftype]
317-
'else [sftype]
313+
stype: file-type? source
314+
type: case [
315+
lib/all ['unbound = as 'extension = stype] [stype]
316+
as [type]
317+
'else [stype]
318318
]
319-
data: read-decode source ftype
319+
data: read-decode source type
320320
]
321321
none? data [data: source]
322322

323323
;-- Is it not source code? Then return it now:
324-
any [block? data not find [0 extension unbound] any [ftype 0]][ ; due to make-boot issue with #[none]
324+
any [block? data not find [0 extension unbound] any [type 0]][ ; due to make-boot issue with #[none]
325325
return data ; directory, image, txt, markup, etc.
326326
]
327327

@@ -339,7 +339,7 @@ load: function [
339339

340340
;-- Bind code to user context:
341341
not any [
342-
'unbound = ftype
342+
'unbound = type
343343
'module = select hdr 'type
344344
find select hdr 'options 'unbound
345345
][data: intern data]
@@ -710,15 +710,15 @@ export [load import]
710710
test: [
711711
[
712712
write %test-emb.reb {123^/[REBOL [title: "embed"] 1 2 3]^/123^/}
713-
[1 2 3] = xload/header/type %test-emb.reb 'unbound
713+
[1 2 3] = xload/header/as %test-emb.reb 'unbound
714714
]
715715
][ ; General function:
716716
[[1 2 3] = xload ["1" "2" "3"]]
717717
[[] = xload " "]
718718
[1 = xload "1"]
719719
[[1] = xload "[1]"]
720720
[[1 2 3] = xload "1 2 3"]
721-
[[1 2 3] = xload/type "1 2 3" none]
721+
[[1 2 3] = xload/as "1 2 3" none]
722722
[[1 2 3] = xload "rebol [] 1 2 3"]
723723
[
724724
d: xload/header "rebol [] 1 2 3"

src/mezz/sys-start.reb

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ start: func [
3333
start: 'done ; only once
3434
init-schemes ; only once
3535

36-
ver: load/type lib/version 'unbound
36+
ver: load/as lib/version 'unbound
3737
system/product: ver/2
3838
system/version: ver/3
3939
system/platform: ver/4
@@ -215,7 +215,7 @@ start: func [
215215
change-dir first script-path
216216
either exists? second script-path [
217217
sys/log/info 'REBOL ["Evaluating:" script]
218-
code: load/header/type second script-path 'unbound
218+
code: load/header/as second script-path 'unbound
219219
; update system/script (Make into a function?)
220220
system/script: make system/standard/script [
221221
title: select first code 'title

0 commit comments

Comments
 (0)