get-word!
evaluates correctly, but Rebol fails to interpret lit-word!
as a valid selector. Red in this case correctly coerces all any-word!
values. So, no, problem is not with get-word!
, problem is with lit-word!
(or any other possible any-word!
value) to which it evaluates. Same holds for paren!
expressions - they are not selectors, but the result of their evaluation is.
@9214
** Script Error: Invalid path value: a
** Near: probe arr/:ind
Yes, it seems that get-word!
evaluates correctly but it seems that we cannot use word!
as path's value. "invalid path value: a" - I assume that a
is a word!
here... but it can be lit-word!
as well. In my opinion that error message is not as clean as you said.
Putting that aside, this answer fully explain differences. Thank you for this.
replace/all read/binary file crlf lf
How do you deal with time-consuming computation in the gui?
make-random-image: has [img ] [
img: make image! 200x200
forall img [img/1: random 255.255.255]
wait 2 img
]
view [i: image [i/image: make-random-image]]
Let's suppose that make-random-image
just takes at least 2 seconds to compute. In those 2 seconds I'm left with unresponsive window. Is there anything I can do to make user experience better such in cases?
ps. I know about memoization and I'm not sure if I can translate this part of code to Red/System.
call
.call "red my-heavy-script.red"
that will write result to some fileon-time
check periodically if second process finished (result file exists, or something like that)window: [
title "Layout"
size 800x800
group-box "01-file-header" 780x50 [
panel
]
return
group-box "02-bookmarks" 780x600 [
panel [
group-box "01.init-variables" 740x70 [
panel [
text {.url-0: >url}
]
]
return
group-box "02.reload-favorites" 740x70 [
panel [
text {.reload-favorites}
]
]
return
group-box "04.add-bookmark.sub-function" 740x70 [
panel [
text {.add-readable favorites 'bookmarks reduce [>url]}
]
]
return
group-box "05.either-block-url" 740x400 [
panel [
group-box "true" 350x400 [
panel
]
group-box "false" 350x400[
panel
]
]
]
]
]
]
view window
Red [
Title: ""
]
file-header: [
]
init-variables: [
]
bookmarks: [
groupbox [
panel init-variables
]
]
window: [
title "Layout"
size 1200x800
group-box "01-file-header" 1000x50 [
panel
]
return
group-box "02-bookmarks" 1150x600 [
panel [
group-box "01.init-variables" 740x80 [
panel [
area 500x40 {.url-0: >url}
]
]
return
group-box "02.reload-favorites" 740x80 [
panel [
area 500x40 {.reload-favorites}
]
]
return
group-box "04.add-bookmark.sub-function" 740x80 [
panel [
area 500x40 {.add-readable favorites 'bookmarks reduce [>url]}
]
]
return
group-box "05.either-block-url" 1100x400 [
panel [
group-box "01.is-block.url.true" 800x400 [
panel [
group-box "01.is-category.first-word.true" 330x400 [
panel [
area "stackoverflow !!!!!!"
]
]
group-box "01.is-category.first-word.false" 330x400 [
panel
]
]
]
group-box "01.is-block.url.false" 500x400 [
panel [
area {.add-readable favorites 'bookmarks (>url)} wrap
]
]
]
]
]
]
]
view window
Red [
Title: ""
]
window: [
title "Layout"
size 1200x800
group-box "01-file-header" 1000x50 [
panel
]
return
group-box "02-bookmarks" 1150x600 [
panel [
group-box "01.init-variables" 740x80 [
panel [
area 500x40 {.url-0: >url}
]
]
return
group-box "02.reload-favorites" 740x80 [
panel [
area 500x40 {.reload-favorites}
]
]
return
group-box "04.add-bookmark.sub-function" 740x80 [
panel [
area 500x40 {.add-readable favorites 'bookmarks reduce [>url]}
]
]
return
group-box "05.either-block-url" 1100x400 [
panel [
group-box "01.is-block.url.true" 800x400 [
panel [
group-box "01.is-category.first-word.true" 430x400 [
panel [
area wrap {favorite-bookmarks: favorites/bookmarks
existing-category: select (favorite-bookmarks) (category)}
group-box "01" [
panel [
area {crash under october build}
]
]
group-box "02" [
]
]
]
group-box "02.is-category.first-word.false" 230x400 [
panel [
area wrap {.add-readable favorites 'bookmarks reduce [>url]}
]
]
]
]
group-box "02.is-block.url.false" 500x400 [
panel [
area wrap {.add-readable favorites 'bookmarks (>url)} wrap
]
]
]
]
]
]
]
view window