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
GiuseppeChillemi
@GiuseppeChillemi
@toomasv using It for start and ending position makes sense.
Toomas Vooglaid
@toomasv
@GiuseppeChillemi Nope, for image it is just ending position.
GiuseppeChillemi
@GiuseppeChillemi
For this question I wish to take a different approach: asking for articles/documentation/chat threads. Which are the resources that cover the bind/context topic for RED ?
Boleslav Březovský
@rebolek
The ultimate document is Bindology by Ladislav Mečíř. It's for Rebol, but the rules are basically the same.
GiuseppeChillemi
@GiuseppeChillemi
@rebolek I know this article but wondering something else has been written RED specific. Also, this topic arise from time to time in chat as FAQ and hope someone is bookmarking the threads or his own messages for further reference.
nedzadarek
@nedzadarek
@toomasv Thank you. Sadly it doesn't work with nested blocks (e.g. [ [1 2] [3 4]]).
ps. for anyone that want examples:
i: make image! [100x100] repeat ith to-integer (93) [ i/:ith: blue ]
  • If I want to copy 96 pixels from the first row I just need to: i2: copy/part i 96x1
  • if you want to copy 96 pixels from the first column then you just need to swap pair: i2: copy/part i 1x96
lepinekong
@lepinekong_twitter
@greggirwin if I follow your reasoning there's no reason why rebol/red find that java/javascript/css suck because people who designed them have also 2 decades of experiences and moreover are adopted by almost every developer in the world, why do you think you have better ideas ;)
@greggirwin as for me I have now near 30 years experiences of managing people with software projects to realize why productivity and quality suck so much and though rebol/red had some good ideas it just don't go as far as it could be and like all tech people they tend NOT to take into account the real need and concept of value.
Gregg Irwin
@greggirwin

We don't think we're better because of our experience, but because of the design. That said, Java is a fine language, even if it's not my cup of tea. It was designed for a specific purpose, and serves that need well. When Red has as many years and additions as Java, then we'll have to see how well we continue to fight complexity and bloat. Red (and Rebol) were designed with very specific goals in mind, and are beautiful languages IMO. However, there's always room for improvement.

But let's come back to the issue at hand. You don't like X, but you haven't shown that you understand why X is the way it is, and if we do what you want, it will hurt the language, not help it. Do you understand why if and while are different in their parameter design? Once you've shown that you do, please provide a concrete proposal which can be discussed and evaluated.

NjinN
@NjinN
@9214 Why do [+: :add] crash my red.exe
Vladimir Vasilyev
@9214
@NjinN because right before that you typed +: :add, redefined addition operator and wreak havoc upon all environment definitions.
NjinN
@NjinN
Why +: :add not
Vladimir Vasilyev
@9214
Because redefinition is harmless by itself, it's usage of all previous functions that rely on the original definition of + (which you just changed) that causes trouble.
NjinN
@NjinN
@9214 Thanks. I know that these codes can not workes, even cause trouble. But I want to know why do [+: :add] crash red.exe, but +: :add don't, what's the difference between them?
Vladimir Vasilyev
@9214
@NjinN launch fresh console and type do [+: :add] right away.
Then again launch fresh console, type +: :add, and only then type do [+: :add]. Or type do [+: :add] twice.
Do you understand why in the former case there is no crash?
Vladimir Vasilyev
@9214
I can only guess why it's happening. GUI console is a View-based app, which probably uses + somewhere. If you'd tried your example in CLI console, it will just spit out an error and quit.
NjinN
@NjinN
I seem to understand a little bit
And what happens when i just type +: :add twice
Vladimir Vasilyev
@9214
You just do the same redefinition two times, and this action, apparently, does not rely on +.
*: :multiply, for example, seems to be harmless.
NjinN
@NjinN
It seems to be harmless, but causes trouble......
Gregg Irwin
@greggirwin
It would be good to see exactly why it's crashing, and catch that in a nicer way. We can also doc that ops are usually made from funcs, to give them infix form.
Novvorto
@novvorto_twitter
Red [needs: 'view]
view [
    f1: field
    button 
        "Evaluate" 
        [
            view [text f1/text]
        ]
    button 
        "Quit" 
        [quit]
]

produces this error message:
Script Error: VID - invalid syntax at: [f1/text] Where: do
Stack: view do-events do-actor do-safe view layout cause-error Script Error: head does not allow none! for its series argument
Where: head Stack: view do-events do-actor do-safe error? do-actor do-safe eval-set-path

Whereas this works:

Red [needs: 'view]
view [
    f1: field
    button 
        "Evaluate" 
        [
            x: f1/text
            view [text x]
        ]
    button 
        "Quit" 
        [quit]
]

I am using red-25oct18-12ad56be.exe.

Is this by design? If it is, what is the purpose?
Boleslav Březovský
@rebolek
You can't use paths as arguments, only words. I don't think it's by design, more like not implemented yet.
Rudolf Meijer
@meijeru
In general, such problems can be solved by inserting compose and putting the information that is to be computed in a paren. In fact, the automatic evaluation of single words is a convenience to save having to write (x).
Semseddin Moldibi
@endo64
view compose [text (f1/text)]or view [text with [text: f1/text]] would also work.
I also would like to see that paths are supported.
Simon
@simonmc_gitlab
hello! is there an equivalent for the Rebol dt function in Red? I'm trying to load a 40MB file that contains a block! without success. I would like to graph the loading time for a sample of files of different size to understand the limits of the Red loader. thank you!
Semseddin Moldibi
@endo64
dt is a very simple function, you can copy/paste from Rebol to Red.
But loading 40MB might not work on Red yet. If it is not mandatory to load, try read and then parse (or read/lines and foreach)
Boleslav Březovský
@rebolek

@simonmc_gitlab

without success

What does it mean? Is there an error, crash, ...?

Simon
@simonmc_gitlab
@endo64 Good idea! Thanks a lot, I don't know why I did not think of that. I will use read -> parse as you suggest
@rebolek the console crashes, it uses over 1.5G and then the console silently crashes
Boleslav Březovský
@rebolek
@simonmc_gitlab I see. I know that problem :(
Simon
@simonmc_gitlab
@rebolek It's ok, for now the workaround of @endo64 is good, thank you :)
Boleslav Březovský
@rebolek
ok
nedzadarek
@nedzadarek
When I was playing with the draw: https://gist.github.com/nedzadarek/836adb9fc20c1e2cb1dce6436133a4ab
I wanted to ask few questions about draw (especially for @toomasv as you are writing a lot vid code):
1) When people post some draw code they don't use set-words (e.g. view [base draw [b: box 2x2 3x3 ] on-up [b/2: b/2 + 1]] but they uses face/draw/N(e.g. view [base draw [box 2x2 3x3 ] on-up [face/draw/2: face/draw/2 + 1]]). Is there a reason for this?
2) We cannot put set-words between elements' arguments (e.g. b1: box pos-start: 2x2 pos-end: 3x3 is not possible). They disallow this because it's just easier to parse (draw) or is there another reason?
Toomas Vooglaid
@toomasv
@nedzadarek About (1) I don't think there are any rules for this. It is matter of personal preferences and your application logic. IMO in some cases it is easier to use set-words (I have heavily relied on these) than positional references on other cases vice versa.
About (2) I think the answer lies here
lepinekong
@lepinekong_twitter
@simonmc_gitlab I found red has improved over rebol as for the number of variables: I didn't reach yet the limit. As for processing large amount of data rebol has never been very scalable and performant. I'm thinking about mixing powershell with red.
Nenad Rakocevic
@dockimbel

@simonmc_gitlab

hello! is there an equivalent for the Rebol dt function in Red? I'm trying to load a 40MB file that contains a block! without success. I would like to graph the loading time for a sample of files of different size to understand the limits of the Red loader. thank you!

Does it load with Rebol2?
If yes, how much memory does it use in Rebol?
Could you provide us with a copy of that file for testing?

GiuseppeChillemi
@GiuseppeChillemi
I wish to store some common functions in external files to be laoded from multiple script.
Which is the correct way of doing this ?
READ and then DO passing arguments (if needed) ? LOAD and then DO passing arguments (if needed) ?
Boleslav Březovský
@rebolek
why not do %script.red
GiuseppeChillemi
@GiuseppeChillemi
@rebolek I wish to store functions which needs to be used often. So loading in memory is needed
Boleslav Březovský
@rebolek
@GiuseppeChillemi if you do script, it is of course loaded in memory.
GiuseppeChillemi
@GiuseppeChillemi
@rebolek but using again the function you are adding to your code needs reloading and I would like to not load it again for the second time as some code needs speed !. File content would be something like:
myfunc: funct  [a b] [print [a + b]]
So myfunct is added to the main code
Boleslav Březovský
@rebolek

@GiuseppeChillemi if you have file that looks like:

Red[]
myfunc: func [x y][x + y]

and then do it in another file:

do %myscript.red

Then you can use myfunc, %myscript.red gets loaded only once.