Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:52
    qtxie labeled #5144
  • 01:52
    qtxie assigned #5144
  • 01:51

    qtxie on master

    FIX: issue #5144 (CRASH when re… (compare)

  • May 22 12:01
    hiiamboris opened #5146
  • May 22 11:59
    hiiamboris labeled #5145
  • May 22 11:58
    hiiamboris opened #5145
  • May 21 16:25
    hiiamboris labeled #5144
  • May 21 16:24
    hiiamboris opened #5144
  • May 21 15:55
    hiiamboris commented #5139
  • May 21 09:27
    GiuseppeChillemi commented #120
  • May 21 07:26
    endo64 commented #120
  • May 20 17:43
    greggirwin commented #5026
  • May 20 17:43
    greggirwin commented #5026
  • May 20 15:18
    rebolek commented #5026
  • May 20 00:33
    ALANVF commented #4552
  • May 19 07:45
    hiiamboris commented #113
  • May 19 07:40
    Oldes commented #113
  • May 18 22:06
    ALANVF opened #5143
  • May 18 20:19
    greggirwin commented #5026
  • May 18 20:18
    greggirwin commented #5026
theangryepicbanana
@ALANVF
this is of course how I designed my language
though I did go off the rails a bit before, I still think it's important to look at all sides of any design issue
Gregg Irwin
@greggirwin
Yes, and you will find that we are generally open to alternate views. Changes do have to be strongly defended though, because so much thought has gone into many aspects already. There are always gaps of course, and things done for expedience or even accidentally.
hiiamboris
@hiiamboris
Gregg Irwin
@greggirwin
It can be hard work, struggling with these choices, but also rewarding and enlightening. If it weren't for all the people I've debated with and learned from, I wouldn't be much of a programmer, or a person.
theangryepicbanana
@ALANVF
@hiiamboris sure, but it still doesn't look as great because | often acts not only as a divider or "indentation", but also as a way to identify the beginning of a branch
yeah I get that
Gregg Irwin
@greggirwin
Ah, composite. When Boris and I are old men we will still debate and change sides on the macro-or-not view. Just when he almost had me, he said "But there is a use case..." ;^)
Gregg Irwin
@greggirwin
Here's a fun thought experiment for you @ALANVF, which you can tinker with in code. Could you add a "begin" operator to do what you want? e.g.
parse "abc" [
    ! "abc"
    | "def"
]
theangryepicbanana
@ALANVF
well I've thought about doing this, something like !: [] would probably work for that just fine
Gregg Irwin
@greggirwin
You're quick. :^)
theangryepicbanana
@ALANVF
I mean it works, but it's a workaround for a simple feature (which is something I highly despise in languages)
I feel like there are better solutions
Gregg Irwin
@greggirwin

It's not a workaround, it's Red being flexible enough to let you do what you want to do, even though it disagrees.

If you feel like there are better solutions, by all means, write them up.

Try not to judge languages too harshly. Workarounds are the compromises of programming, and without some level of compromise it's hard to accomplish anything.

To be clear, you do understand that your view is not "right" here, yes? It's just your view, and a different choice. Not better, just different.
theangryepicbanana
@ALANVF
yeah
Gregg Irwin
@greggirwin
:+1:
theangryepicbanana
@ALANVF
it's just how I see things. I do try not to judge design choices to harshly, but in the case of languages like Haxe, there becomes enough "workarounds" and such that it becomes painful to accomplish anything
Gregg Irwin
@greggirwin
You'll find agreement here that not all languages are equally well designed. ;^)
theangryepicbanana
@ALANVF
of course
Red can get away with it because it's a very powerful homoiconic language, however many languages are not and still try to act like it's no biggie
however it can get to a point where you spend more time working around the language than working with it
GiuseppeChillemi
@GiuseppeChillemi
So, the rule is: if the function is on the stack, its context is available to other functions, otherwise you get a context not available error
f1: func [arg] [f2: func [x][probe (get x) * 2] f2 'arg] 
>> f1 22
44
f1: func [arg] ['arg] 
f2: func [x][probe (get x) * 2]
>> f2 f1 22
*** Script Error: context for arg is not available
*** Where: get
*** Near : x
*** Stack: f2 probe  

>>
Oldes Huhuman
@Oldes
I don't understand, what you want to do, but in your case, first is evaluated f1 22 with result arg, which has no context.
>> f1: func [arg] [:arg]
>> f2: func [x][probe (get x) * 2]
>> f2 f1 22
44
== 44
(at least in R3, does not work in Red, but you probably want something totally different anyway)
GiuseppeChillemi
@GiuseppeChillemi
I simply want to underline when the context of ARG is available, as rule. If the function has not returned, you can pass one of it words to another one, otherwhise, no context is available.
I have written this, so if there is an error in this rule, someone will correct me.
Gregg Irwin
@greggirwin
Not everyone here monitors the red/gui-branch room, but check this out: https://gitter.im/red/red/gui-branch?at=628754784aa6c31dca0f02e4
GiuseppeChillemi
@GiuseppeChillemi

Yes, there are a lot of subtle differences between Red and Rebol.

Red

>> a: ["hello" world]
== ["hello" world]
>> a/"hello"
== world
>>

Rebol

>> a: ["hello" world]
== ["hello" world]
>> a/"hello"
** Syntax Error: Invalid path -- a/
** Near: (line 1) a/"hello"
>>

A lot are really nice!

theangryepicbanana
@ALANVF
wait, that's a thing in red? I thought that was only for hash!s
GiuseppeChillemi
@GiuseppeChillemi
Yes, in Rebol you must use: a/("hello")
In Red you have more freedom
theangryepicbanana
@ALANVF
ah ok
theangryepicbanana
@ALANVF
curious, what's the purpose of the more member for function!s? https://github.com/red/red/blob/master/runtime/datatypes/structures.reds#L263
is it the body of the function?
ohhhh it's a node of other fields
Mo
@mosee101
hello, is there a way for Red/Rebol to detect a keypress down on keyboard, and after detecting the keypress, have red press another keyboard key...can i also do this with the mouse clicks?
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
Yes, maybe, yes
Greg T
@gltewalt
view [base 300x300 "Type some keys, and view your console." on-key-down [print mold event/key]]
Greg T
@gltewalt
view [
    base 300x300 "Type some keys, and view your console." 
    on-key-down [if event/key = #"L" [print "You found the L key!"]]
]
Greg T
@gltewalt
Example: on-key-down
If you mean something like SendKeys, I believe @toomasv had made someting for Windows
Check out the red/help, and red/gui-branch rooms for more help
GiuseppeChillemi
@GiuseppeChillemi

Another interesting discovery today:

Rebol:

a: [b c]
get 'a/b

** Script Error: get expected word argument of type: any-word object none
** Where: halt-view
** Near: get 'a/b

a: make object! [b: 'c]
get 'a/b

** Script Error: get expected word argument of type: any-word object none
** Where: halt-view
** Near: get 'a/b

Red

a: [b c]
get 'a/b
== c

a: make object! [b: 'c]
get 'a/b
== c

So, in Red you can get path while in Rebol you must use do

The only thing I don't like is the error I receive is I try to access a non existent element:

a: [b c]
get 'a/c
*** Script Error: cannot access c in path a/c
*** Where: get
*** Near : 'a/c
*** Stack:  

>>
It is incongruent with paths result on non existent paths, which none. Also forces me to use the slow try method.
hiiamboris
@hiiamboris
GiuseppeChillemi
@GiuseppeChillemi
We are facing the same problems...