@@ -281,22 +281,22 @@ load: function [
281
281
source [file! url! string! binary! block! ] {Source or block of sources}
282
282
/header {Result includes REBOL header object (preempts /all)}
283
283
/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."
286
286
] [
287
287
; WATCH OUT: for ALL and NEXT words! They are local.
288
288
289
289
; NOTES:
290
290
; Note that code/data can be embedded in other datatypes, including
291
291
; not just text, but any binary data, including images, etc. The type
292
292
; 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.
294
294
; 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
296
296
; to be handled properly by DO (keeping it out of user context.)
297
297
; Extensions will still be loaded properly if /type is 'unbound.
298
298
; 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.
300
300
301
301
assert/type [local none! ] ; easiest way to protect against /local hacks
302
302
@@ -305,23 +305,23 @@ load: function [
305
305
306
306
;-- Load multiple sources?
307
307
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 ]]
309
309
]
310
310
311
311
;-- What type of file? Decode it too:
312
312
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 ]
318
318
]
319
- data: read-decode source ftype
319
+ data: read-decode source type
320
320
]
321
321
none? data [data: source]
322
322
323
323
;-- 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]
325
325
return data ; directory, image, txt, markup, etc.
326
326
]
327
327
@@ -339,7 +339,7 @@ load: function [
339
339
340
340
;-- Bind code to user context:
341
341
not any [
342
- 'unbound = ftype
342
+ 'unbound = type
343
343
'module = select hdr 'type
344
344
find select hdr 'options 'unbound
345
345
][data: intern data]
@@ -710,15 +710,15 @@ export [load import]
710
710
test: [
711
711
[
712
712
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
714
714
]
715
715
][ ; General function:
716
716
[[1 2 3 ] = xload ["1" "2" "3" ]]
717
717
[[] = xload " " ]
718
718
[1 = xload "1" ]
719
719
[[1 ] = xload "[1]" ]
720
720
[[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]
722
722
[[1 2 3 ] = xload "rebol [] 1 2 3" ]
723
723
[
724
724
d: xload/header "rebol [] 1 2 3"
0 commit comments