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!
construct a character from a string
A string is composed of characters, so such wording doesn't make much sense in this context. You might want to extract a character from a string rather.
>> t: "12345"
== "12345"
>> repeat a length? t [ print t/a ]
*** Script Error: word! type is not allowed here
*** Where: print
*** Stack:
>> repeat a length? t [ print t/(a) ]
1
2
3
4
5
>>
a
, but inside parens a
is first evaluated to number and only then path is accessed. String is series, and you can access its elements by index numbers but not by literal words. Other structures can be accessed by words, e.g.:>> t: [a b c]
== [a b c]
>> t/a
== b
>> t: #(a: 1 b: 2)
== #(
a: 1
b: 2
)
>> t/a
== 1
>> t: object [a: 1 b: 2]
== make object! [
a: 1
b: 2
]
>> t/a
== 1
@MartenH
Thanks a lot! Was looking for something like "rejoin" , but I could not find it:http://static.red-lang.org/red-system-specs-light.html
on a side note - you shouldn't look at R/S docs, because they are not about Red, but about Red/System, a low level dialect. Here's a list of learning resources, but you also should get familiar with probe
, source
, help
, what
, ?
and ??
functions.
@greggirwin
@nd9600, there is no line information in errors. It would come up at times in the Rebol community, but I haven't seen it requested for Red yet. It's tricky, and Carl talked about it at one point, because there isn't always a concept of "lines". That is, Red doesn't need to maintain new line markers for processing in loaded code. Practically speaking, we use them a lot.
Greg, if Red code is just data , why can't the error indicate which element "#" in the series code block the error happened at?
action!
, routine!
and native!
?
object!
and function!
both hold a reference to context!
values internally.