Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 11 19:32

    greggirwin on master

    cs/DT/float.adoc modified Merge branch 'master' of https:… docs-cs: cs/(float, reactivity,… and 1 more (compare)

  • Aug 11 19:32
    greggirwin closed #186
  • Aug 11 09:00
    Tovim opened #186
  • Aug 07 15:51

    dockimbel on master

    FEAT: describes more explicitly… (compare)

  • Aug 07 15:19

    dockimbel on master

    FEAT: adds the default value bl… (compare)

  • Jul 31 12:13
    meijeru opened #185
  • Jul 19 22:36

    greggirwin on master

    docs-cs: DT/pair.adoc Merge pull request #183 from To… (compare)

  • Jul 19 22:36
    greggirwin closed #183
  • Jul 15 18:01

    greggirwin on master

    Fixed typo in line 7 Some cleanup of float.adoc Merge pull request #184 from gl… (compare)

  • Jul 15 18:01
    greggirwin closed #184
  • Jul 15 04:32
    gltewalt synchronize #184
  • Jul 15 04:06
    gltewalt opened #184
  • Jun 18 09:23
    Tovim opened #183
  • Jun 16 18:05

    greggirwin on master

    Created README file Merge pull request #182 from en… (compare)

  • Jun 16 18:05
    greggirwin closed #182
  • Jun 16 14:11
    endo64 opened #182
  • Jun 14 17:13
    greggirwin commented #181
  • Jun 14 17:12

    greggirwin on master

    pair! comparison Merge pull request #181 from lo… (compare)

  • Jun 14 17:12
    greggirwin closed #181
  • Jun 14 10:28
    loziniak opened #181
Vladimir Vasilyev
@9214
@Tovim might be a good idea to update your toolchain to the latest release first, and to follow the main branch of development more closely.
Gregg Irwin
@greggirwin
@Tovim, @dockimbel updated the map docs, as he had the best knowledge of the new changes. The updates are based on commits in the past couple days. As @9214 said, you are probably just out of date a bit.
Tovim
@Tovim
I am glad the things has been explained. Now I have the latest Red-27may-19 and the 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:
  • The command in the line 221 (remove/key m 'b) returns
    == #( a: 1   "c" 3   d: 99)
    whereas in the text, there is written:
    == #(   a: 1)
  • Examples in lines 240, 243, 246 produce outputs b, a, A respectively, whereas in the text, there is written'b, 'a, 'A.
Gregg Irwin
@greggirwin
Confirmed. The examples need to be corrected. @gltewalt would you take care of that?
Thanks @Tovim! Will get your PR merged shortly as well.
Greg T
@gltewalt
I’ll take a look
Greg T
@gltewalt
@greggirwin PR with fixes sent
nedzadarek
@nedzadarek

As I'm translating email doc there is no mention about accessors:

>> system/catalog/accessors/email!
== [user host]

maybe we can add

== 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"
`` `

before == Comparision?

ps. I added space inside 3 backticks so gitter will parse it.
Gregg Irwin
@greggirwin
Good catch @nedzadarek. We can model it on date and image, and also need to add a Path Accessors section to pair, time, and event. @gltewalt is quite busy at the moment, but we should probably do the English version first, then translate.
nedzadarek
@nedzadarek
@greggirwin yes, I meant English version first but as I'm not native speaker I want somebody to check (and/or give opinions).
Gregg Irwin
@greggirwin
:+1:
nedzadarek
@nedzadarek

In the float doc:

to binary! interprets the first 8 bytes as a floating point number.

I'm confused. Why should to binary! return float! (interprets as floating point number). Even if it means "using first 8 bytes" why not just something like this:

to binary! will use the first 8 bytes

Gregg Irwin
@greggirwin

That section could use some cleanup. Converting to and from should be clearer.

The any-list part could remove some prose.

An any-list! value must contain two numbers. The result will be the first number multiplied with the value of 10 to the power of the truncated second number. first-number * (power 10 second-number)

Could be

An any-list! value must contain two numbers. The result will be first-number * (10 ** second-number)

The binary example is backwards from the text. It described 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.

Greg T
@gltewalt

Uhhh.... @greggirwin could you make those changes? (I know you’re already very busy)

I added the accessor part for email! but I can’t tend to float soon

Gregg Irwin
@greggirwin
I'll make a ticket for it in the docs repo, so we don't forget. First one to get to it wins. :^)
Greg T
@gltewalt
:+1:
mikeparr
@mikeparr
I've just updated Red-by-example, with around 200 new entries. Some of the new entries for functions are simply the docstrings (sorry), and the recent version of Red simplified the automation of this. The main index page is even more massive, and mostly I use the brower 'find' to search it. (Actually, I like the single page, but think that it could be split as well.) http://www.red-by-example.org/index.html
Boleslav Březovský
@rebolek
:+1:
Toomas Vooglaid
@toomasv
:clap:
Gregg Irwin
@greggirwin
Thanks @mikeparr !
It's a long page, but loads instantly for me.
Dave Andersen
@dander
Thanks @mikeparr! I like the single page format, and it's a terrific resource for me.
nedzadarek
@nedzadarek
In the red_docs\docs\en\datatypes\get-word.adoc there is missing r in the retieves (line 7 after Abstract).
ps. I would push that change myself but I've forked the repo and I've pushed some translations already... so it would be mess.
Greg T
@gltewalt
Fixed
Greg T
@gltewalt
@greggirwin The binary example is backward?
* `to binary!` interprets the first 8 bytes as a floating point number. If there are fewer than 8 bytes, #{00} bytes are prepended.

```red
>> to binary! 42.3
== #{4045266666666666}
```
nedzadarek
@nedzadarek
thank you
Gregg Irwin
@greggirwin
@gltewalt backward meaning that floats should always contain 8 bytes? Or that zero bytes are not prepended?
@dockimbel, should floats convert to char!? I know it's easy, but what is the use case?
nedzadarek
@nedzadarek
@greggirwin I think he meant "as floating point number" part.
Phryxe
@Phryxe
The link from "The source code for the gpio:// scheme can be found there." in latest article shows a 404 error.
There is another dead link to the same file in the end of the article.
Semseddin Moldibi
@endo64
Thanks @Phryxe
Correct URL should be https://github.com/red/red/blob/master/environment/schemes/GPIO.red I'll inform the team.
Vladimir Vasilyev
@9214
@Phryxe thanks, fixed. Article was written prior to port-type branch being merged into master.
ralfwenske
@ralfwenske

In https://doc.red-lang.org/en/preprocessor.html is this example

Red []
#macro pow2: func [n][to integer! n ** 2]
print pow2 10
print pow2 3 + pow2 4 = pow2 5

last line should be:

print [pow2 3 "+" pow2 4 "=" pow2 5]
Gregg Irwin
@greggirwin
@gltewalt :point_up:
Semseddin Moldibi
@endo64
@ralfwenske I think not, when you compile your script, the output is as below: (different from running the script in REPL)
D:\test.exe
100
true

And you can see the details by using 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]

Output:

100
true
[9 + 16 = 25]
ralfwenske
@ralfwenske
Thanks @endo64 I start to realise that preprocessing for interpreter doesn’t make that much sense.
(… would be nice though if we could say what runs interpreted runs compiled - and vice versa :) )
Semseddin Moldibi
@endo64

Yes, that is a limitation, but may be change in the future.
2 other points:

You can also see the expanded version of your script by using --show-expanded argument during the compilation, for easier debugging:

Red []
#macro pow2: func [n][to integer! n ** 2]
print pow2 10

Output:

Compiling D:\Projects\Red\red\build\bin\test.red ...
...using libRedRT built on 30-Jul-2019/13:43:21
[
    print 100
]
...compilation time : 29 ms
Semseddin Moldibi
@endo64

And you may examine system/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

It can be used to extend to replace macros on REPL. There are better examples for use of pre-loader from @toomasv and others.

Vladimir Vasilyev
@9214

would be nice though if we could say what runs interpreted runs compiled - and vice versa

Everything wrapped in do [...] is interpreted, the rest is statically compiled. With -e everything is interpreted.

@endo64 I would argue against suggesting pre-load to newcomers (and pretty much everyone else), not until we get a decent reader macros support.

And you don't need compilation with -s, using expand from console is enough for quick experiments.

ralfwenske
@ralfwenske
Thanks @endo64 @9214 It all is a great learning experience - and I enjoy very much the language (Rebol/Red) plus this great helpful community. Thank you all.
Semseddin Moldibi
@endo64
@9214 You are right, promoting pre-load is not a good idea, I just mention it because @ralfwenske said that he wants to learn & play with different aspects.
Rudolf Meijer
@meijeru
An interesting feature emerged from discussion of issue #3359: it is allowed to 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.
Gregg Irwin
@greggirwin
The above link should be red/red#3359
Rudolf Meijer
@meijeru
Correct. Any comments on the substance?
Gregg Irwin
@greggirwin
Nenad's comment on the ticket itself seems sufficient.