Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 02 17:18
    greggirwin commented #200
  • Nov 02 15:09
    qtxie commented #200
  • Nov 02 14:26
    hiiamboris edited #200
  • Nov 02 14:21
    hiiamboris edited #200
  • Nov 02 14:17
    hiiamboris opened #200
  • Nov 01 22:28
    greggirwin commented #199
  • Nov 01 22:28

    greggirwin on master

    docs-cs: Repairs and missing tr… docs-cs: filio Merge pull request #199 from To… (compare)

  • Nov 01 22:28
    greggirwin closed #199
  • Nov 01 19:56
    Tovim opened #199
  • Oct 04 18:23
    greggirwin opened #198
  • Sep 17 22:14
    greggirwin commented #192
  • Sep 17 22:14

    greggirwin on master

    docs-cs: recent changes (image.… Merge branch 'master' of https:… docs-cs: cs\datatypes\map.adoc… and 1 more (compare)

  • Sep 17 22:14
    greggirwin closed #192
  • Sep 16 07:43
    qtxie transferred #197
  • Sep 16 07:39
    meijeru opened #197
  • Sep 15 18:30
    Tovim reopened #192
  • Sep 15 18:30
    Tovim closed #192
  • Sep 15 18:29
    Tovim reopened #192
  • Sep 15 18:28
    Tovim closed #192
  • Sep 15 18:19
    Tovim synchronize #192
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.
Rudolf Meijer
@meijeru

Something to note somewhere: a comma , 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

It appears that a number starting with a comma does not need to be separated from a preceding word by whitespace.

Vladimir Vasilyev
@9214
@meijeru red/red#3569
Rudolf Meijer
@meijeru
My point is different from that in the issue quoted: it is about the need for separation...
Also, it is not a bug/issue, just a note worth documenting.
Rudolf Meijer
@meijeru
Another gotcha: in order to check if a function refinement has been specified in the call, the function body can do an if <refinement> but when the refinement carries further arguments, one sometimes sees a check on those directly: if <optional-argument>. 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.
Vladimir Vasilyev
@9214
Are there any functions in Red codebase that use more than single argument for their refinements?
Rudolf Meijer
@meijeru
Do you mean like func [... /a b c ...] ?
Vladimir Vasilyev
@9214
@meijeru yes.
Rudolf Meijer
@meijeru
That has no bearing on my above remarks. The problem starts when you do, inside the body of the function: 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.
Vladimir Vasilyev
@9214

@meijeru my point was - why separation between refinements and their arguments exist in the first place, if, as far as I know, most refinements use only one argument? You can, in theory, just use refinement value itself as an argument.

func [/refinement argument][if refinement [use argument]] ; refinement is just a flag, argument bears the actual value

vs

func [/refinement][if refinement [use refinement]] ; refinement carries the value AND serves as a flag of its presence

Your example is a "desync" of 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.

What your idiom states is "first check refinement, which is always logic!, then check and use its argument(s), which, by design, may or may not be an actual logic! or none! value(s)".
Rudolf Meijer
@meijeru
This is an interesting design point. But how would you do this lexically? In order to specify the expression which is the value of the refinement, before making the call, you would have to do something like /refinement: <expr>, introducing a "refinement set-word".
Vladimir Vasilyev
@9214
@meijeru uhm... there's no need for additional lexical forms. You just don't specify arguments and use refinement itself as a (typed) argument. Nevermind though, it's unrelated to our discussion. But it's worth checking R2, R3 and Red code for presence of more than single argument for refinements - that would actualize the language design point. Functions with more than 3 arguments (both mandatory and optional) is already a code smell, so, we need some baseline to argue when it comes to library implementations and coding style.
Rudolf Meijer
@meijeru
@dockimbel What do YOU think?
Gregg Irwin
@greggirwin
I don't know of any standard funcs that take more than one refinement arg, but I have written funcs like that myself in the past. There is no problem, and nothing special about logic args. You have to code for them just as you would anywhere else, when a value can be none or false.
Rudolf Meijer
@meijeru
@9214 I find the discussion about refinement usage worth pursuing a bit more, but have addressed it in a private message.
Rudolf Meijer
@meijeru
@gregg See 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..
Vladimir Vasilyev
@9214
@meijeru it's interesting how this pattern parallels common Forth idiom - use no more than 3 cells on a stack; something to note on "Red for X" pages.
Gregg Irwin
@greggirwin
Thanks for the research @meijeru !
Dave Andersen
@dander
should the properties with spaces such as line width here be hyphenated instead?
nedzadarek
@nedzadarek

Is it worth linking to the url wiki definition (or its translations) in the url documentations?
I mean this line:

== Abstract

An url! value represents a reference to a network resource and allows for directly expressing Uniform Resource Locators.

Gregg Irwin
@greggirwin
I don't think so. Either we choose a single ref, or clutter with multiple links to wikipedia, IETF specs, etc.
Vladimir Vasilyev
@9214
@greggirwin red/docs#190
Gregg Irwin
@greggirwin
Thanks!
hiiamboris
@hiiamboris
Regarding https://github.com/red/red/issues/3337#issuecomment-528502174 (the last @dockimbel's comment), I believe it should be noted in the reactivity docs that deep-reactor! tracks changes not only in series but also in composite scalars (pairs, tuples, date, time). In contrast to reactor! that does not.
Gregg Irwin
@greggirwin
@hiiamboris agreed. Would you please open a ticket in the red/docs repo for that?
hiiamboris
@hiiamboris
mkay
Nikita Korotkin
@TheHowdy_gitlab
Just wanted to note that the "Getting Started" guide on the Red website (https://www.red-lang.org/p/getting-started.html) is out of date; the documentation says that the GUI -Systemis still Windows only, and the first "Going further..." link is dead (redprogramming.com does not seem to be online)
lucindamichele
@lucindamichele
@TheHowdy_gitlab Thank you, and we know...there are a number of changes we are working on.
GiuseppeChillemi
@GiuseppeChillemi
Gregg Irwin
@greggirwin
Thanks! @gltewalt, can you patch that at your convenience?
Maciej Łoziński
@loziniak
>> 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!] 
[...]
Should find accept objects or not?
Vladimir Vasilyev
@9214
@loziniak red/red@7b1eeb7
Maciej Łoziński
@loziniak
@rebolek perhaps it would be nice to mention #get and #in directives in this document?: http://red.qyz.cz/red-system-from-red.html
mikeparr
@mikeparr
Future of http://www.red-by-example.org/
Over the past few years, Arie and myself (more recently) have operated and updated the pages. Currently Arie is quite ill, and I am not particularly inspired to do much updating. Also, Arie pays to host the site, and he wishes to stop paying.
So, we are looking for someone to:
  • rehost the site
  • maintain it (I can advise, initially)
    Any offers?
GiuseppeChillemi
@GiuseppeChillemi
Great project. It would be good to convert it to a wiki so the community can maintain it.
My blessings go to Arie.
Gregg Irwin
@greggirwin
My best to Arie as well. We all appreciate the effort both of you have put into it. Ping me in a week if I don't reach out before then.
mikeparr
@mikeparr
Thanks for the comments re Red BY Example. The initial crucial issue is hosting.
Semseddin Moldibi
@endo64
@mikeparr & Arie, thanks for all your efforts. Hope Arie will get better.