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
Semseddin Moldibi
@endo64
Or use /extern refinement in function: f: function [/extern x] [ return view/no-wait [ button "test" [ x: "hello" ] ] ] so x would be set in global context.
nedzadarek
@nedzadarek
@DavidConroy not sure if it's a bug or not but /no-wait seems to be a culprit.
f: function [] [return view [do [x: none] button "test" [x: "hello" probe x]] ] vs g: function [] [return view/no-wait [do [x: none] button "test" [x: "hello" probe x]] ] both has x as local (?? g) but only 2nd one doesn't work.
DavidConroy
@DavidConroy
That's perfect thanks @toomasv, @endo64, @nedzadarek ... I "knew" that about func, but didn't make the connection. Also I didn't realise you could selectively extern function variables. As for the "no-wait" solution, I have no idea... Cheers
Vladimir Vasilyev
@9214
@nedzadarek /no-wait is not the culprit. In the first case f calls view and waits until it finishes, and x has its context available because we're using it during f call. In the second case you explicitly ask to not enter View event loop, so you instantly get face object back, which has x in it bound to f. Problem is that f is gone, since function call was just finished. Hence the error message.
And I suspect that @DavidConroy uses stable build, because it was long ago patched to "context for x is not available", which is more accurate.
DavidConroy
@DavidConroy
That's right, stable build.
Is the development build recommended?
Vladimir Vasilyev
@9214
@DavidConroy currently yes, because "stable" one is almost a year old.
And perhaps what you're looking for is f: does [...].
lepinekong
@lepinekong_twitter
@nedzadarek ok thanks but seems to me it is more an internal reason to red that leaks to outside whereas outsiders don't care except by consistency from their own viewpoint ;)
nedzadarek
@nedzadarek
@9214 I see.
@DavidConroy I think you need to test it. I have been using non-stable version from 26-Mar-2018 because newer version had memory leak and high cpu usage. Red 0.6.3 for Windows built 22-Oct-2018/19:39:48+02:00 commit #d3c8c4f seems to be "stable" enough but I need to test it more.
lepinekong
@lepinekong_twitter
@toomasv so you use turtle/rate: 8 for animation ok thanks
nedzadarek
@nedzadarek
@lepinekong_twitter I think it depends how much the Red/Rebol you will use. For me dichotomy of if's truthy value and while's block of code (condition) seems natural.
I have checked the Ruby - it doesn't have this dichotomy but it has more verbose syntax (if <condition> then <then-block> end & while <condition> do <do-block> end). I don't see that syntax as weird... it all depends on the language of choice. Some languages have some things you just don't like. You can like it or hate it - de gustibus non est disputandum.
Gabriele Santilli
@giesse

@lepinekong_twitter

@nedzadarek of course I had seen any-type and block in help. My point is I contest this design choice as a condition is semantically one thing so there's no reason to have 2 different sets for value.

The problem here is that you are missing something pretty important. Gregg and others are trying to help you by giving you a chance to understand, instead of just memorizing an answer to the question. If you don't care, I'll be happy to tell you why they HAVE to be different.

lepinekong
@lepinekong_twitter
@giesse I can't see what I'm missing you pretend that design choice is good, I pretend that it isn't because you design for facilitating the language implementation instead of facilitating the user of the language.
Gregg Irwin
@greggirwin

@lepinekong_twitter, your view on what is good for a user of the language is no more correct than the rest of us, and given that the original designer of Rebol, and people with deep design experience and almost 2 decades of use with Redbol langs, disagree with you just might count for something.

Let me make it clear, you quite consistently complain about Red's design, saying it's wrong, and that is simply not the case. Red is designed to be the way it is. If it isn't what you think it should be, you can either back up your claims with facts and concrete examples to support your view, or you can implement your own language (using Red if you want).

If you want to continue this topic, here's what you need to do. 1) Show us that you understand the current design. 2) Provide examples for your proposed change and explain how it's better. @giesse said he's happy to explain why they are different, and you can take him up on that, as others may learn (or someone else can ask for his explanation as well if they want).

Gregg Irwin
@greggirwin
We all have to play by (at least roughly) the same rules. You say we pretend that the design choices is good, but we can defend our position quite easily. All we ask is that you do the same.
Ivan Vandot
@vandot

@greggirwin switched to help, thanks, sorry for spamming docs...
@9214 this is a while loop so it just infinitely fails as you said
@rebolek read/binary also fails

2018-10-24 19:42:25.049 console-2017-8-3-49893[50282:5010968] CFNetwork SSLHandshake failed (-9836)
*** Access Error: cannot connect: https://source.unsplash.com/random/310x200 reason: timeout

maybe some issue with SSL handshake as log says...
read https://freegeoip.app/csv/ works
from curl -vvv it looks like SSL is configured the same on both endpoints, only diff is response time

Gregg Irwin
@greggirwin
@vandot no worries.
Ivan Vandot
@vandot
Red 0.6.3 - macOS
Boleslav Březovský
@rebolek
@vandot console-2017-8-3 - this seems like a pretty old version, there were some already fixed problems.
Vladimir Vasilyev
@9214
@vandot grab latest version.
Boleslav Březovský
@rebolek
It works here with latest version (on Linux):
>> read/binary https://source.unsplash.com/random/310x200
== #{
FFD8FFE000104A46494600010101004800480000FFE2021C4943435F50524F46
Ivan Vandot
@vandot
Thanks, it works with latest build :) I used brew for installation... brew cask install red and now I find that is the stable and I should install with brew cask install red-latest. Thanks again!
GiuseppeChillemi
@GiuseppeChillemi

@nedzadarek I wish to return to this topic:
( https://gitter.im/red/help?at=5bbd2756600c5f64237ef9e1 )

foo: [bar [baz 42]]
w: 'foo/bar/baz
get w
; == 42
reduce w
; == 42

I expected GET to return the LIT-PATH and not the value, as I read "get the value of W which is a LIT-PATH".

probe to-path GET w
; == 42

This because I associate the tick " ' " to "not evaluate, passive object which"

Ungaretti
@Ungaretti
How do I capture a key event on a base face? The idea is to use arrow keys for drawing.
Boleslav Březovský
@rebolek
@GiuseppeChillemi w is not lit-path! but path!, because lit-path! gets evaluated already.
Vladimir Vasilyev
@9214
@Ungaretti use on-key and event/key.
Boleslav Březovský
@rebolek
use quote if you don want to evaluate it.
Vladimir Vasilyev
@9214
@GiuseppeChillemi use quote 'foo/bar/baz if you want a lit-path!.
Dang! :mouse:
Ungaretti
@Ungaretti
@9214 That seems to works on area, but not on base.
Vladimir Vasilyev
@9214
Or, use get 'w without quote.
GiuseppeChillemi
@GiuseppeChillemi

@rebolek

@GiuseppeChillemi w is not lit-path! but path!, because lit-path! gets evaluated already.

I have not understood this phrase

Vladimir Vasilyev
@9214
@GiuseppeChillemi if you don't understand something, try to experiment in console.
Boleslav Březovský
@rebolek
@GiuseppeChillemi
>> w: 'foo/bar/baz
== foo/bar/baz
>> type? w
== path!
>> w: quote 'foo/bar/baz
== 'foo/bar/baz
>> type? w
== lit-path!
Vladimir Vasilyev
@9214
Type 'foo/bar and see what happens. Then type type? 'foo/bar and see that what you get is a path!.
Boleslav Březovský
@rebolek
or follow the :mouse:
Vladimir Vasilyev
@9214
@Ungaretti
view [base focus on-key [probe event/key]]
GiuseppeChillemi
@GiuseppeChillemi
Gitter keeps returning to the thread point of 10 oct. Does this happen to you too ?
Boleslav Březovský
@rebolek
No. Try refreshing the page.
Ungaretti
@Ungaretti
@9214 Amazing! Thanks!
GiuseppeChillemi
@GiuseppeChillemi

@9214
I have tried

>> 'foo/bar
== foo/bar
>> type? 'foo/bar
== path!
>> type? foo/bar
*** Script Error: foo has no value
*** Where: type?
*** Stack:  

>> type? foo/bar
*** Script Error: foo has no value
*** Where: type?
*** Stack:

As the standard working is "words in paths are not evaluated", the message "foo has no value" seems that foo is getting REDUCED,but I know it is not the correct-

(talking about type? foo/bar)
Vladimir Vasilyev
@9214
Words in paths are not evaluated until the path itself gets evaluated, which you just did.
Do you understand why ' is there for words and paths?
GiuseppeChillemi
@GiuseppeChillemi
Since learing about it on REBOL manual I assumed: "take the following word -as is-" and not the value of the word.
(reducing)
Vladimir Vasilyev
@9214
Words get evaluated to their values, unless you precede them with ' tick or use function which quotes its arguments.
Same goes for paths, they evaluate to some value.