Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:19
    @PeterWAWood banned @TimeSeriesLord
  • Aug 13 2016 03:23
    @PeterWAWood banned @Vexercizer
Vladimir Vasilyev
@9214
Pierre Baille
@pbaille
hahaha
yes red seems to really be a mindshift
nedzadarek
@nedzadarek

@greggirwin Yes, I mean can as suggestion. Other people (you included) know Red's internals so you may know/guess pross and cons of this.

find the features that add significant benefit

Sometimes small and insignificant features change a language a lot. For example:

  • The Rebol's/Red's or the Ruby's "no need for parenthesis in function call" make them very suitable for creating DSLs.
  • letting function/words to touch any-series! lets you fake syntax: e: func [a] [a], this is possible: e<foo>, e"ooo" or e[...].

@pbaille @9214 There is no Red?!
You can treat this "mental burden" from other language like some things to compare, learn from (we have talked about it so it's more talk to pbaile than you 9214). Well, we should let him/her do whatever floats his/her boat.

Vladimir Vasilyev
@9214
@nedzadarek there're some thing in Red and Rebol that are not presented in other languages, so there's nothing to compare with and learn from.
And this is the part where a person should build the right, strong mental model instead of re-interpreting everything in terms of his/her past programming experience.
Sticking to preconceptions and attempts to apply old models will only make the learning curve steeper.
Pierre Baille
@pbaille
@9214 i agree, but it is hard to let go :) being able to abord new things with a blank mind requires much wisdom
@nedzadarek thank you for the empathy ;)
Vladimir Vasilyev
@9214
@pbaille at first - don't let them go. Just put aside for a while ;)
Pierre Baille
@pbaille
hahaha yes it is more safe :)
nedzadarek
@nedzadarek
@9214 Yes, of course. We should be open minded. However no language is an island. Languages are in families, have ancestors/precursors. I have yet to met a language where I have to learn from scratch (no counting assemblers and esoteric languages).
@pbaille "blank mind" - it will require much more time.
Vladimir Vasilyev
@9214
@nedzadarek well, if you're well-versed with Rebol, Lisp and Forth, then learning Red is a piece of cake for the most part. Yet, @pbaille is Clojurian, and even he scratches his head a bit (as far as I can see).
nedzadarek
@nedzadarek
@9214 Yes, I had that moments too. However I programmed a little with the Rebol, tried Lisp family (Racket as fair I remember) and tried/programmed a little in the Factor which is "descendant" of Forth. I have programmed or just tried programming in many languages. Your/his mileage may vary.
Hmm... it's my opinions. I wonder if there a study of this. There is second language aquisition for natural languages. There should be one for programming languages.
Pierre Baille
@pbaille
the thing seems to be that so much freedom is kind of overwhelming, it is a bit like when i came to clojure, and understand that design patterns have not so much sense there, with red it seems to be the next step. In a few days it will be better. but yes, the language is really easy to pick up, the easiest that I learned so far i think.
nedzadarek
@nedzadarek
@pbaille the Rebol/Red and the Ruby are very "user friendly". I think Yukihiro Matsumoto, the creator of Ruby, has this philosophy of simplicity (being easy to program). I don't want to speak about the creator of the Rebol (the Red precursor) because I'm not so knowledgeable as others.
Vladimir Vasilyev
@9214
Rebol's motto is "rebel against complexity", which IMO includes "being easy to program", but is not limited to it.
nedzadarek
@nedzadarek
@9214 "Rebol against complexity" - I have to remember this.
hiiamboris
@hiiamboris
a metaprogrammer in me just rebelled too...
>> f: func [x][print 420]
== func [x][print 420]
>> f 1
420
>> clear body-of :f   f 1
>> append body-of :f [print 420]   f 1
420
>> clear spec-of :f
== []
>> ? f
USAGE:
     F 

DESCRIPTION: 
     F is a function! value.

>> f
*** Script Error: f is missing its x argument
*** Where: f
*** Stack: f
Vladimir Vasilyev
@9214
@hiiamboris interesting, it doesn't happen if you haven't called f previously.
Something to do with function's spec/body internal caching I suppose.
hiiamboris
@hiiamboris
so.. another ticket then?
Vladimir Vasilyev
@9214
@hiiamboris maybe it's worth to comment on that one red/red#3171
nedzadarek
@nedzadarek
Can I create object! with unset values? I wanted to do something like this: context [a: b: c: UNSET-VALUE]. I can do this but I have to do it a casu ad casum:
c: make object! [a: b: c: 1]
; >> unset in c 'a
; >> unset in c 'b
; >> unset in c 'c
c
; == make object! [
;    a: unset
;    b: unset
;    c: unset
; ]
Vladimir Vasilyev
@9214
@nedzadarek
>> set/any c: object [a: b: c: none] ()
>> c
== make object! [
    a: unset
    b: unset
    c: unset
]
I wouldn't recommend that though, as none is good enough to indicate the absence of expected values.
unset is more of an internal beast whose usage you should avoid as much as possible.
nedzadarek
@nedzadarek
@9214 Great!
I'm messing with binding/contexts and blocks so unset! is wanted but I know it's dangerous.
Vladimir Vasilyev
@9214
@nedzadarek or unset body-of ..., but you'll face red/red#3338
set/any is better though, because unset doesn't distinguish between object's fields and other words.
nedzadarek
@nedzadarek
I guess I'll stick with set/any
Pierre Baille
@pbaille
what am i missing here?
o1: object [a: 1 b: object [c: 1]] 

o2: copy/deep o1

o1/b/c: 3

o2/b/c ;=> should be 1 no?
Vladimir Vasilyev
@9214
@pbaille but you've just copy/deeped it, no?
>> o1: object [a: 1 b: object [c: 1]] 
== make object! [
    a: 1
    b: make object! [
        c: 1
    ]
]
>> o2: o1
== make object! [
    a: 1
    b: make object! [
        c: 1
    ]
]
>> o1/b/c: 3
== 3
>> o2/b/c
== 3
Pierre Baille
@pbaille
in this case I understand the behavior, since o1 and o2 points to the same thing, but i'm doing a copy, i should obtain 2 different objects with the same value no?
and be able to mutate 1 without altering the other
Vladimir Vasilyev
@9214
@pbaille the key phrase is "2 different objects".
Ah, I see what you mean, my bad. You've copied top-level object, but not the nested one (the one that is bound to b).
Pierre Baille
@pbaille
yes indeed
copy/deep doesn't do that?
Rudolf Meijer
@meijeru
I would also think that the deep copy should not be affected by the change in the original. Worth an issue! At the minimum we should get a better explanation of copy/deep.
Vladimir Vasilyev
@9214
@pbaille no, AFAIK copy/deep copies deeply nested series.
Pierre Baille
@pbaille
ho i see
Vladimir Vasilyev
@9214
@meijeru R2's copy/deep doesn't even accept object!, and /deep dosctring states:
     /deep -- Also copies series values within the block.
Pierre Baille
@pbaille
ok
Rudolf Meijer
@meijeru
So now we have the explanation, but do we like it?
Vladimir Vasilyev
@9214
@meijeru agreed, initially I was confused too. Would you like to file an issue?
FYI, R3 has the same behavior (and the same /deep docstring as in R2).
Pierre Baille
@pbaille
does any of you has a oneliner that do what i want?