Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 23 22:24
    9214 updated the wiki
  • Aug 23 15:05

    dockimbel on atomic

    FEAT: adds support for system/a… (compare)

  • Aug 23 13:40

    dockimbel on atomic

    FEAT: improved the implementati… (compare)

  • Aug 23 12:52
    dockimbel commented #3991
  • Aug 23 12:27
    9214 commented #3991
  • Aug 23 12:13
    planetsizecpu commented #3991
  • Aug 23 12:12
    planetsizecpu commented #3991
  • Aug 23 11:18
    dockimbel commented #3991
  • Aug 23 10:14

    qtxie on atomic

    TEST: add some failed cases in … (compare)

  • Aug 23 10:06

    qtxie on atomic

    TESTS: add test for CAS operati… (compare)

  • Aug 23 09:22

    qtxie on atomic

    TESTS: add some tests for atomi… (compare)

  • Aug 22 21:26

    dockimbel on atomic

    FEAT: adds get-word support for… (compare)

  • Aug 22 21:00

    dockimbel on atomic

    FEAT: adds support for system/a… (compare)

  • Aug 22 17:48

    dockimbel on atomic

    FEAT: preliminary support for a… (compare)

  • Aug 22 15:51

    dockimbel on atomic

    FIX: removes some unused local … (compare)

  • Aug 22 15:20

    dockimbel on atomic

    FEAT: adds support for system/c… (compare)

  • Aug 22 10:35
    bitbegin assigned #4004
  • Aug 22 10:35
    bitbegin unassigned #4004
  • Aug 22 10:28
    bitbegin commented #3952
Nenad Rakocevic
@dockimbel

@gltewalt

I think we need this: http://www.rebol.com/r3/docs/functions/title-of.html

Why?

Nenad Rakocevic
@dockimbel

@zinid

Yeah, but duck typing is a real problem, I full of this in Erlang and Python

There is no duck typing in your code example or the code version Peter posted above. Peter just set the word now in global context to 2, so that the conditional expression then returns true.

Nenad Rakocevic
@dockimbel
@maximvl Here is a "capture by reference" closures generator. I think it should also "reset" the external words to their initial values on each call of the closure.
Evgeny Khramtsov
@zinid
Boleslav Březovský
@rebolek
@zinid There can't be only 5 Red repos when I alone have six of them ;)
Nenad Rakocevic
@dockimbel
@zinid I count about 24 there: https://github.com/trending/red
Evgeny Khramtsov
@zinid
@rebolek that's strange I got only 5, whatever
seems like a problem in github search
Nenad Rakocevic
@dockimbel
@zinid You query returns 15 results here. Seems github searching feature is really flawed.
Evgeny Khramtsov
@zinid
yep
Boleslav Březovský
@rebolek
well, we have Github API (both REST and GraphQL), so we can build or own search functions :)
Nenad Rakocevic
@dockimbel
@rebolek Could it be possible to build a good Gitter searching tool? (because the existing search field on Gitter is really a joke)
Boleslav Březovský
@rebolek
@dockimbel Of course, there are basic search tools in gitter-tools that work much better (over downloaded data) than Gitter search. There's just no GUI for it yet, I will try to add it, when I've got some time.
Nenad Rakocevic
@dockimbel

@dockimbel

@maximvl Here is a "capture by reference" closures generator.

Sorry, I meant "capture by value".

Vladimir Vasilyev
@9214
@rgchris cheers!

Could it be possible to build a good Gitter searching tool?

oh god yes please

François Jouen
@ldci
Hi, RedCV library is updated for Red 0.6.3 here: https://github.com/ldci/redCV
Maxim V
@maximvl
@dockimbel in this example I would expect state to flip it's value:
>> x: closure [z /local state] [ probe state: not state z + y ]
== func [z /local state][probe state: not state z + y]
>> x 1
true
== 6
>> x 2
true
== 7
>> x 3
true
== 8
otherwise looks very good
BeardPower
@BeardPower
Does anyone know, if q-plot was already ported to Red or if there is another plot/chart lib for Red?
Boleslav Březovský
@rebolek
@BeardPower I have one, but it is unreleased currently.
BeardPower
@BeardPower
@rebolek Nice. A port or a different lib? Are you planning to release it?
Boleslav Březovský
@rebolek
@BeardPower yes, I want to release it together with text-table, once GC is ready. It is not a port, it is written from scratch for Red.
Maxim V
@maximvl
@dockimbel forget my example, it's not relevant
it's good enough:
>> adder: func [x] [ closure [y] [ x + y ]]
== func [x][closure [y] [x + y]]
>> adder-2: adder 2
== func [y][x + y]
>> adder-2 3
== 5
>> adder-2 4
== 6
>> adder-2 5
== 7
>> adder-5: adder 5
== func [y][x + y]
>> adder-5 1
== 6
>> adder-5 3
== 8
>> adder-2 5
== 7
I was thinking about having state in a local context, where in lisps I would use let, but in Red it's just a context :D
Maxim V
@maximvl
>> myf: select context [state: off f: closure [x] [ probe state: not state x ] ] 'f
== func [x][probe state: not state x]
>> myf 1
true
== 1
>> myf 2
false
== 2
>> myf 3
true
== 3
but the way contexts work this will work with just any function
suddenly things are quite simple
Vladimir Vasilyev
@9214
@maximvl why use select?
>> myf: context [state: off f: closure [x][probe state: not state x] return :f]
== func [x][probe state: not state x]
>> myf 1
true
== 1
>> myf 2
false
== 2
Maxim V
@maximvl
hm
because I see context as an object which has only fields inside
can you actually write any kind of code there?
Vladimir Vasilyev
@9214
spec is evaluated before actual object is constructed
Maxim V
@maximvl
>> context [x: 5 return 2 + x]
== 7
is it ok to do things like this?
is return somehow special or how does it work?
this is an interesting feature, but I need some clarification on details :D
I have a feeling that return, break, continue and others work somehow differently in Red
Boleslav Březovský
@rebolek
@maximvl That’s interesting, I would have expected error here. However you can have code in context definition:
>> context [x: 5 print 2 + x]
7
== make object! [
    x: 5
]
Maxim V
@maximvl
in "regular" language semantics I would expect the following code to return 7
z: func [] [ context [x: 5 return 2 + x ]  100]
z
while in Red it's 100
meaning return doesn't return from z but from something else
PeterWAWood
@PeterWAWood
I think it is a bug in the context function, a type of Red Injection attack.
>> make object! [x: 5 return x + 2]
*** Throw Error: return or exit not in function
*** Where: return
*** Stack:  

>> context [x: 5 return 2 + x]
== 7
>>
Vladimir Vasilyev
@9214
>> z: func [] [return context [x: 5 return 2 + x ] 100]
== func [][return context [x: 5 return 2 + x] 100]
>> z
== 7
@PeterWAWood so you say that I used injection attack in my code? :O
here, if some field in constructed object is none, I return none instead of that object
oh, but turns out it doesn't work with make reactor! :D
PeterWAWood
@PeterWAWood
Rebol ignores a call of return in a context arg.
>> o: context [x: 5 return 2 + x]
>> context [x: 5 return 2 + x]                               
>> probe o
make object! [
    x: 5
]