@nedzadarek There is one more accessor: set-word!
c: [a: 1 b: 2 (y 5) 6]
y: 'a
c/:y
;== 1
y: quote (y 5)
c/:y ; But this gets the evaluated result of parens, which is 5, so 5th element
;== (y 5)
c/(y) ; This selects as `select/only`
;== 6
Consider also this
c: [a: 1 b: 2 (y 5) 6 x 3 x: 4]
y: quote x:
;== x:
c/:y ; Selects first x
;== 3
c/(y) ; Also selects first x
;== 3
select/same c quote x: ; Only this selects exactly
;== 4
select/same c y
;== 4
@greggirwin @toomasv thank you.
@toomasv right, I forgot about get words. Also good point about:
y: quote (y 5)
c/:y ; But this gets the evaluated result of parens, which is 5, so 5th element
;== (y 5)
c/(y) ; This selects as `select/only`
;== 6
I have not used get words with parens. I thought that everything is passed "as-is" (integer as integer, block as block etc). I mean you set some selector (for example: selector: 42
) and you want to select value from collection based on that value not something evaluated or changed (only exception is any-word are treated the same). One reason to use one or another syntax (arr/:a
vs arr/(a)
).
call/output "ipconfig" s: make string! 255
to tuple! copy/part pos: find/tail find s "IPv4 Address" ": " find pos "^/"
; == 192.168.0.16
Red[]
print "Content-type: text/html^/"
print random 10
copy {}
is perfectly fine.
default-size
is, you need to check Red sources.