If you need help, try to find the answer through the following path: `Help` in the console ⇒ [Red by Example](https://www.red-by-example.org/) ⇒ [Official Red Docs](https://github.com/red/docs/blob/master/en/SUMMARY.adoc) ⇒ [Rebol Core Manual](http://www.rebol.com/docs/core23/rebolcore.html ⇒ [Red Wiki](https://github.com/red/red/wiki ⇒ Net search "redlang + your-question" ⇒ Ask us, we are here to help!
set-word!
is - it's just this type of marker. set-word!
points to location in source code, while variables usually point to location in memory. But there's no variables in Redbol. In a vague sense, script's body is it's own memory. Entire script is just one big chunk of self-modifiable state, which can be trivially serialized, saved and restored.
When you:
STR: "" ;"" is data structure position 2
insert STR "ah"
STR: "" ;"" is data structure position 7
insert STR "bb"
you are stating: SET STR to what you find at position 2 of your data structure ("")
Then: insert on what is rapresented in position 5 (word "ah") on position 2
Then: set STR to what is rapresented in position 7 (second "") and use THIS POSITION in further reference to get/set the contend of STR
then insert on POSITION 7 "bb"
If this code loops, the first STR will take again the value "ah" insted of "BB" as it will use the content of position 2. The second one will use te conent of position 7.
Carl also refers to Rebol scripts as expressions. He says "REBOL Expressions are based on this concept: you combine values and words into blocks".
The chapter Expressions in the Rebol User Guide is pretty much essential reading.
@dockimbel :point_up: September 29, 2017 12:13 PM
@geekyi How to do you end up with those counts?
I used a program that reads strings in memory
@GiuseppeChillemi, lexical scanning is the first step. Parsing and tokenizing the input to find Red values in the text, and determining if the input is valid. That is, it contains all valid Red values.
At that point you have a block of values. Think about how you, as a human, interpret that. You know some values are direct values, like numbers. But what happens when you find a word? You need to determine what to do. What kind of word is it? What is the behavior of each kind of word?
Glad if it helped a bit @RiVeND. Parse
is deep, and hard to describe in prose/text, because the behavior and data mixture will be verbose. An interactive tool will be much better, so you can see what rule is being evaluated, the current location in the input, and maybe hints about keyword behavior. e.g. if ahead
is evaluated, a "does not advance" indicator could light up.
There was an old parsing tool, VisualParse++, from Sandstone technology, that did something like that. It was a shift-reduce parsing tool, and was pretty cool.
Hi
I'm new to the language and I'm trying to do something that I think is quite simple, but I fail.
I just want to convert a hexadecimal byte that is on string format to a binary value.
Something that works:
t: #"^(AB)"
a: to binary! to-hex/size (to integer! t) 2
print a
I now want to "construct" t so that "AB" can be a string, ie construct a character from a string if that makes any sense.
I know that are other ways to do this but this got interesting.