Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 01 2018 17:34
    @greggirwin banned @BIjeuca_twitter
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:20
    @PeterWAWood banned @TimeSeriesLord
ne1uno
@ne1uno
Abdullah Yiğiterol
@abdllhygt
@rgchris thanks! @9214 i learned Rebol. (was a proposed alternate name)
Vladimir Vasilyev
@9214
@HeyPPP First, if you want to be heard - don't spam like that. Second - Red (programming language) doesn't have Telegram group, most of the community concentrated here, on Gitter, on Reddit, or on our mailing list. RED (community token) group can be found in the link that @ne1uno sent to you.
phrmoy
@phrmoy
Hey guys, do expect 1.0 before 2019?
Vladimir Vasilyev
@9214
Hey @phrmoy, there's no ETA on 1.0 release. I doubt it will happen that soon even with the amount of resources that the core team recently gathered. Such things require a lot of time and effort.
phrmoy
@phrmoy
Gotcha, thanks for sharing.
Vladimir Vasilyev
@9214
You're welcome.
ibalbaert
@Ivo-Balbaert

On May 18 the first printed book on Red was officially published by Packt Publishing:
[Packt Publishing] (https://www.packtpub.com/application-development/learn-red-%E2%80%93-fundamentals-red)
Amazon

The book is primarily meant for newcomers to the language. It was expertly reviewed by Rudolf Meijer with a foreword by Gregg Irwin.

Nenad Rakocevic
@dockimbel
@Ivo-Balbaert Great news! Will Packt tweet about it, so we can retweet them?
BuilderGuy1
@BuilderGuy1
@Ivo-Balbaert Bought it !! Today... a CRUD app, tomorrow... THE WORLD !!!
Steeve
@SteeveGit
Also just bought it, but made a little error in the billing adress :smile: At least I can read the pdf
Toomas Vooglaid
@toomasv
:+1:
ibalbaert
@Ivo-Balbaert
@SteeveGit Send me your correct address, I will make sure they send it to you
Steeve
@SteeveGit
Thx @Ivo-Balbaert, I already changed my address on their site, but since they validated my command before that, I was just wondering if they would use the last and correct address for the shipment
Gregg Irwin
@greggirwin
Congrats on getting the book out Ivo!
Keshav negi
@Kesujii_twitter
heyo guys, what was ICO price?
Vladimir Vasilyev
@9214
@Kesujii_twitter https://t.me/redofficial
Jose Luis
@planetsizecpu
article.jpg
@Ivo-Balbaert Yesterday I wrote this article in spanish forum, there are 600+ readers by now
I hope that help and community to grow ;)
Vladimir Vasilyev
@9214
@AlexanderBaggett last 10 messages in this room were about this book, if you haven't noticed.
Alexander Baggett
@AlexanderBaggett
I know its so cool right?
Vladimir Vasilyev
@9214
Well, it depends.
guraaku
@guraaku
I hope it's good ! :)
Remigiusz Kozdra
@vejitatoja
I'm having problem with understanding this behavior in my script. I was thinking that
word: and set word
:word and get word
+ and add
were equivalent.
Can you help me understand why the functions fail in all but the first case and what should i do if i would like to use the shorthand syntax instead of set and get and add?
Red []

x: 1
y: 1
i: 1
m: 1

inc-with-set: func ['word value] [set word add get word value]
inc: func          ['word value] [word: add get word value]
inc-broken: func   ['word value] [word: :word + value]
inc-broken2: func  ['word value] [set word add :word value]

inc-with-set x 2
inc y 2
; inc-broken i 2
; inc-broken2 i 2

print x
; 3
print y
; 1
print i
; *** Script Error: + does not allow word! for its value1 argument
; *** Where: +
; *** Stack: inc-broken
print m
; *** Script Error: add does not allow word! for its value1 argument
; *** Where: add
; *** Stack: inc-broken2
Vladimir Vasilyev
@9214
@vejitatoja
word: 'value is the same as set 'word 'value, same for get. + and add are not equivalent, even if both perform addition - first is an infix operator, second is a function.
Vladimir Vasilyev
@9214
inc doesn't work as expected because you set word, not x. In inc-brokenand inc-broken2, :word evaluates to x, not to integer.
Remigiusz Kozdra
@vejitatoja
how should i rewrite those functions to behave as i intended?
Vladimir Vasilyev
@9214
@vejitatoja
>> x: 0
== 0
>> inc: func ['word value][set word add get word value]
== func ['word value][set word add get word value]
>> inc x 1
== 1
>> x
== 1
>> inc: func ['word value][do probe compose [(to set-word! word) add get word value]]
== func ['word value][do probe compose [(to set-word! word) add get word value]]
>> inc x 1
[x: add get word value]
== 2
>> x
== 2
>> inc: func ['word value][do probe reduce [to set-word! word to get-word! word '+ 'value]]
== func ['word value][do probe reduce [to set-word! word to get-word! word '+ 'value]]
>> inc x 1
[x: :x + value]
== 3
>> x
== 3
>> inc: func ['word value][do probe compose [set word add (to get-word! word) value]]
== func ['word value][do probe compose [set word add (to get-word! word) value]]
>> inc x 1
[set word add :x value]
== 4
>> x
== 4
Vladimir Vasilyev
@9214
Your confusion comes from the usage of literal argument, I believe. Try to rewrite all of the above with [word value] spec instead to grasp the semantics.
Or step aside from functions entirely and tinker with something like:
>> x: 0
== 0
>> type? 'x
== word!
>> get 'x
== 0
>> word: 'x
== x
>> type? word
== word!
>> word
== x
>> get word
== 0
>> 
>> word: 'x
== x
>> set 'x 1
== 1
>> x
== 1
>> set word 2
== 2
>> x
== 2
>> set word 1 + get word
== 3
>> x
== 3
Gregg Irwin
@greggirwin

@vejitatoja, @9214 already provided some great details, so I'll just add that it's easy to see how a set-word! and set are not directly equivalent.

>> word: 1
== 1
>> set word 1
*** Script Error: set does not allow integer! for its word argument
*** Where: set
*** Stack:

As @9214 said, the best thing to do is play until you understand things a bit more.

As you can see set-word!s are not just shorthand syntax.
Boleslav Březovský
@rebolek
@greggirwin I don't understand you example. word: 1 is equivalent to set 'word 1, not to set word 1.
Greg T
@gltewalt
I think that’s the point
Boleslav Březovský
@rebolek
ok then. I still hadn't my morning tea and coffee ;)
Anyway, to me they are directly equivalent. Even in @greggirwin's example, he's changing set-word! to word!.
Vladimir Vasilyev
@9214
@rebolek you can't use set-word! syntax if you don't know word's spelling in advance.
While you can set some word without even knowing how it looks like.
Boleslav Březovský
@rebolek
>> x: 'a do reduce [to set-word! x 5]
== 5
>> a
== 5
Vladimir Vasilyev
@9214
@rebolek that's no the point.
set changes word's value in its context, word: either creates new entry or changes value in the context where evaluation happens.
Vladimir Vasilyev
@9214
not* the point
You can't write x: by yourself if you don't know that it's actually x.
Boleslav Březovský
@rebolek
If that's point, it's not communicated in Gregg's post very clearly.
Vladimir Vasilyev
@9214
@rebolek maybe he skipped his coffee?
Boleslav Březovský
@rebolek
@9214 Ouch. I hope he's fine.
Vladimir Vasilyev
@9214
He didn't post his :^) in a while... :worried:
Boleslav Březovský
@rebolek
suspicious...
Greg T
@gltewalt

word gets evaluated immediately, so you get the value. Equivalent to set 1 1.

This works and will not throw an error, but you are setting x, not word:

word: 'x
== x
set word 1
== 1
word
== x
x
== 1
```

I think that's all he was trying to point out.