in: set-word, which will effectively kill the console. E.g. in: "XXX-------". I suggest changing in: there to e.g. inp: or some other (set-)word that is not disturbing the system.textdoesn't support them all, per https://github.com/red/red/issues/2735. Thanks.view [ style text: text 100x100 black yellow text left "left" text center "center" text right "right" text top "top" text middle "middle" text bottom "bottom" ]
request-http method in runtime/simple-io, how can I use it in my code?write/info http://server [POST data-here]send-request function that tries to make this stuff easier https://github.com/rebolek/red-tools/blob/master/http-tools.red#L181R2: >> select/skip [a 1 2 b 3 4] 'b 3 == [3 4] R3 & Red: >> select/skip [a 1 2 b 3 4] 'b 3 == 3
R2: >> - 5 == -5 R3 & Red: >> - 5 *** Script Error: - operator is missing an argument ;; use negate for unary minus
-, other op!s throw an error.select, I remember chat, too, but not where it was. The new behavior is more consistent, and matches the doc string better, though I wouldn't say it's more useful. The catch, of course, is that I didn't use that behavior very often in R2. It's usefulness comes at a cost. /part in select it switches to records mode so what you select is the record (a block of values) instead of a single value in the block.>> select/skip [1 2 3 4 5 6] 1 3 == [2 3]
[1 2 3 4 5 6] treated as [1 [2 3] 4 [5 6]], so select can return only [2 3] or [5 6] by selecting 1 or 4 (others will return none)text-list face for displaying formatted source text, rather than using area. The precise reasons for this are immaterial, but I found out that the text-list face ignores tabs when displaying the items in the data facet. They are not even replaced by spaces, but simply suppressed. This is missing in the GUI documentation.Red/System Implementation Todo-list to Wiki, since that's where it points.en folder to a new one and rename it to 2 letter language code, pl for Polish (http://www.lingoes.net/en/translator/langcode.htm), .gitignore?/docs repository/docs wiki, link to language-specific Gitter rooms that we have and/or active contributorsgit pull , git add , git commit -m , and git push .git clone of course.en folder of the main repo, so if you decide to translate into another language you should copy all those files. .gitignore would be good, but gitbook server is not required to work with, hence they are not added. If you add those files accidentally, PR won't be accepted by the owner.en or keep them missing? Is @koba-yu available to continue his contribution?operátory instead of oprátory? I'm not Chech but google translator fixes this for me that way.enenen, as the other languages do not seem to have readme filescs already translated your en/readme.adoc file.Howto for documentation translators, put it into top-level readme in en and cs.pull request with your latest modifications translated. I have not translated the text in TRANSLATION. adoc and did not include it in the cs folder, because whoever wants to translate the english documentation into his own language, he must be comfortable with the english version of "how to"./datatypes/ segment in the link paths.Datatypes, the heading, as a link to the datatypes page, where it is now. But have a second one at the end of the nav bar, after Coding Style Guide, call it Datatype List or something, and have the individual datatypes there, so they still render, but the long list of them is now out of the way, and not obscuring the GUI and other content. Then the datatypes page has links to the individual pages as well.Datatype listing header contractable and expandable in place. I do not know that this is possible in Asciidoc.Datatypes page may not need to contain another links to datatypes. Maybe, it would become to this page if it contained some clever introduction to the whole Red datatypes system.as:>> ? as USAGE: AS type spec type [datatype! block! ...] ...
datatype! type should not be presented, as there existsts (haven´t found any) no value, which could be to this datatype converted.>> as block! quote () == [] >> as integer! quote () *** Script Error: cannot coerce paren! to integer! *** Where: as *** Stack:
integer! is not presented as a possible type for as, while datatype! is. Nevetheless:>> as datatype! quote() *** Script Error: cannot coerce paren! to datatype!
datatype! is a possible type of the first argument to as, which means that any _value_ of type datatype! is allowed, including but not limited to datatype! itself. However, the result may not be defined for every combination of first and second argument type. See the spec document [here](https://github.com/meijeru/red.specs-public/blob/master/specs.adoc#casting-of-values-as). datatype! refers to all existing types. "Not all possible related types have their component values stored in identical fashion."datatype! have their component values stored in identical fashion, there would be enough to declare types of both arguments as datatype! or maybe more consistently as any-type - which is not our case.datatype! is not at the top. See https://github.com/toomasv/red-type-hierarchy/blob/master/Red%20datatypes%20hierarhy.pdf or https://github.com/toomasv/red-type-hierarchy/blob/master/Red%20type%20hierarchy2.pdfhelp output with what you think would be better.>> ? as USAGE : AS type spec DESCRIPTION : Coerce a series into a compatible datype without copying it. AS is a native! value. TYPE : [block! paren! any-path! any-string!] "The datatype or example value." SPEC: [block! paren! any-path! any-string!] "The series to coerce."
block! for example, because the literal block! is a value of type datatype!. So the typespec of the first argument MUST contain datatype!.literal block has been meant a block, created by using literal syntax then the outcome could by even more interesting:>> dt: [one 2 "three"] == [one 2 "three"] >> type? dt == block! >> as dt string! *** Script Error: as does not allow datatype! for its spec argument
dt is a block! in one situation and a datatype! in anotheras procedure fails because its second argument (string!) is in the error message interpreted as datatype! as procedure is not the second but the first argument: >> as string! dt *** Script Error: cannot coerce block! to string!
as is for related types. It doesn't do conversion, it just changes representation. So you can change i.e. paren! to block! or string! to tag!, but not block to string!. See any- types.as.>> as [any all first] file! *** Script Error: as does not allow datatype! for its spec argument
>> as [any all first] file! *** Script Error: as does not allow datatype! for its spec argument *** Where: as *** Stack: >> as block! file! *** Script Error: as does not allow datatype! for its spec argument *** Where: as *** Stack: >> as integer! file! *** Script Error: as does not allow datatype! for its spec argument *** Where: as *** Stack: >> as 1 "" *** Script Error: as does not allow integer! for its type argument *** Where: as *** Stack: >> as integer! "" *** Script Error: cannot coerce string! to integer! *** Where: as *** Stack:
>> as datatype! block! >> as block! datatype! *** Script Error: as does not allow datatype! for its spec argument
switch. map.adoc file. If that is not true, the following post is intended for somebody else engaged. Well:*** Script Error: remove has no refinement called key ``` * Examples in lines 240, 243, 246 produce wrong results:
`remove/key idiom works. Neverthless, differences still exists between the output of the interpreter and the text in the map.adoc file, which I am making the author of the original friendly aware of:== #( a: 1 "c" 3 d: 99)
== #( a: 1)
b, a, A respectively, whereas in the text, there is written'b, 'a, 'A.>> system/catalog/accessors/email! == [user host]
== Field accessing / accessors (not sure how to name it) Username: `` `red >> e: user1@domain1.com == user1@domain1.com >> e/user == "user1" `` ` Host value: `` `red >> e: user1@domain1.com == user1@domain1.com >> e/host == "domain1.com" `` `
== Comparision?to binary! return float! (interprets as floating point number). Even if it means "using first 8 bytes" why not just something like this:first-number * (power 10 second-number)first-number * (10 ** second-number)to float!. And your new text seems better. Beyond that, an example of what happens with truncated data (less than 8 bytes) should either be included, or we should say that's not supported.red_docs\docs\en\datatypes\get-word.adoc there is missing *r* in the *retieves* (line 7 after *Abstract*). * `to binary!` interprets the first 8 bytes as a floating point number. If there are fewer than 8 bytes, #{00} bytes are prepended.redchar!? I know it's easy, but what is the use case?gpio:// scheme can be found there." in latest article shows a 404 error.port-type branch being merged into master.https://doc.red-lang.org/en/preprocessor.html is this exampleRed [] #macro pow2: func [n][to integer! n ** 2] print pow2 10 print pow2 3 + pow2 4 = pow2 5
print [pow2 3 "+" pow2 4 "=" pow2 5]
D:\test.exe 100 true
expand-directives:Red [] #macro pow2: func [n][to integer! n ** 2] print pow2 10 print pow2 3 + pow2 4 = pow2 5 probe expand-directives [pow2 3 + pow2 4 = pow2 5]
100 true [9 + 16 = 25]
--show-expanded argument during the compilation, for easier debugging:Red [] #macro pow2: func [n][to integer! n ** 2] print pow2 10
Compiling D:\Projects\Red\red\build\bin\test.red ...
...using libRedRT built on 30-Jul-2019/13:43:21
[
print 100
]
...compilation time : 29 mssystem/lexer/pre-load, default value is none but if you put a function there it will be called during the scanning (on REPL only, no effect on compiled exe)>> system/lexer/pre-load: func [s] [replace s "*" "+"] == func [s][replace s "*" "+"] >> 3 * 5 == 8
pre-loader from @toomasv and others.do [...] is interpreted, the rest is statically compiled. With -e everything is interpreted.pre-load to newcomers (and pretty much everyone else), not until we get a decent reader macros support.-s, using expand from console is enough for quick experiments.pre-load is not a good idea, I just mention it because @ralfwenske said that he wants to learn & play with different aspects.make action and native values. This is basically because the toolchain itself uses make to pre-define all actions and natives, and it was not deemed necessary or useful to forbid this feature after the initialization phase. However, (1) only existing actions and natives can be (re)made, and (2) the function spec has to be suppplied and if you get that wrong, a crash may occur. In "my" spec document, I have added wording to the effect that this is not recommened. Apparently, R3 alllowed it, but R2 did not., is allowed as replacement for the decimal point. Now because floating point numbers starting with a decimal point are allowed, and on the other hand a decimal point is also allowed in a word! value, one has the following possibilities:>> b: load "a,1" print [mold b type? b] [a 0.1] block >> b: load "a.1" print [mold b type? b] a.1 word
if but when the refinement carries further arguments, one sometimes sees a check on those directly: if . I could cite various lines in the Red toolchain code. This works most of the time, since optional arguments which are not present in the call are initialized to none. However, when the type of the optional argument is logic! and it IS present in the call as false, this if breaks down.func [... /a b c ...] ?if b [... use b ...] instead of if a [ ... use b ...] and a happens to be true i.e. specified, and b happens to be false. Then the first coding idiom is dangerous.func [/refinement argument][if refinement [use argument]] ; refinement is just a flag, argument bears the actual value
func [/refinement][if refinement [use refinement]] ; refinement carries the value AND serves as a flag of its presence
refinement and its argument. In what I described above there's nothing to synchronize in the first place, but... cases where refinement is logic! or none! are still tricky.logic!, then check and use its argument(s), which, by design, may or may not be an actual logic! or none! value(s)"./refinement: , introducing a "refinement set-word".layout in VID.red. It is the only example in the whole codebase with a refinement (/parent) that has 2 arguments... How I know? I did an exhaustive search by program, which is just a variation on the different programs like the concordance that I have previously written.. line width [here](https://doc.red-lang.org/en/draw.html#_default_values) be hyphenated instead?url! value represents a reference to a network resource and allows for directly expressing Uniform Resource Locators.deep-reactor! tracks changes not only in series but also in composite scalars (pairs, tuples, date, time). In contrast to reactor! that does not.>> a: object [b: "test"]
>> find a 'b
*** Script Error: find does not allow object! for its series argument
*** Where: find
*** Stack:
>> ? find
USAGE:
FIND series value
DESCRIPTION:
Returns the series where a value is found, or NONE.
FIND is an action! value.
ARGUMENTS:
series [series! bitset! typeset! any-object! map! none!]
[...]find accept objects or not?#get and #in directives in this document?: http://red.qyz.cz/red-system-from-red.htmlred-by-example.github.io. This would require creating a GitHub organisation called *red-by-example*, and anybody could be a part of it if added to it's "people". The problem I see is that somebody could make PRs or issues in repo dedicated for rendering output, instead of source repo. But perhaps it's not a big problem, and these people could be redirected to the right place. Also there could be info in README.md, that it's not the right place for contributions.red-by-example organization name is already taken. If anybody knows the owner, I'd like to contact him/her. Meanwhile, I create new one. redbyexample.red-by-example account.