« first day (1651 days earlier)      last day (2129 days later) » 

12:15 AM
0
A: How to Convert a Red/Rebol String into a Series

user3908316Brilliant. This works. As does: case [ find tag "chapter" [print "The tag is chapter."] find tag "list" [print "The tag is list."] ] Rebol/Red syntax is kind of elegant. Learning it quite enjoyable :)

 
12:45 AM
0
A: How to Convert a Red/Rebol String into a Series

HostileFork The statements below both execute, but the second one definitely shouldn't execute. if [find tag "chapter"] [print "The tag is chapter."] if [find tag "list"] [print "The tag is list."] This is a very common new-user issue, and understandably so. A key thing to remember about BLOCK! ...

 
1:28 AM
⁠>> print {Hey, RebolBot, do you see this?}
>> print {Hey, RebolBot, do you see that?}
@RebolBot ping?
Killed by Unicode, I suppose. Story of my life.
 
@earl Sometimes I wonder if we should have a bot to watch rebolbot...
 
@johnk Not sure about the self-healing abilities of the bot, but I think I may have killed it and it needs a restart ... :/
>> code: [return 42] do does [do code]
Dynamic RETURN called!
== 42

>> do does [return 42]
Definitional RETURN called!
== 42

>> return 99
Dynamic RETURN called!
** Throw error: return or exit not in function
Works, injects via /local, runs the testsuite w/o (unexpected) regressions, builds hostilefork.com w/o regressions, is (slightly) slow(er).
Definitional by default, no spec option to not bind RETURN, only for RETURN, only for FUNCTION!.
In brief: works, now only(TM) needs to be done properly :)
But with that I'll get some sleep. Have fun.
 
1:49 AM
(217f36bd93b032c0e07c33937d7cd557111bf19a)
 
 
3 hours later…
5:03 AM
Oh, the disappointment:
rebol2> foo: does [print bar]
context [bar: "Hello" bind second :foo self]
foo
(rebolbot answers)
Hello
>> foo: does [print bar]
context [bar: "Hello" bind body-of :foo self]
foo
(rebolbot answers)
*** ERROR
** Script error: bar has no value
** Where: foo
** Near: foo
@RebolBot alive?
 
5:27 AM
@johnk alive?
 
Just
Not sure what's going on there. Let me take a look
 
Was just seeing if I could figure out restarting the bot, not having much success.
 
5:43 AM
@RebolBot alive?
 
red> 5
 
; Brought to you by: try.rebol.nl
== 5
 
@rgchris just bad timing. I got a load of errors from the bot which happens when it has trouble connecting to the chat site. Hypothesis is that stackoverflow rebooted something. Hence all the cookies were invalidated ...
 
Ah, that...
 
5:48 AM
I have been playing with Grahams so chat client and extracting the auth code so the bot will soon be able to log in by herself
Then I can get onto more interesting stuff
Are you keeping busy?
 
Yp.
You?
 
Young kids take a lot of time. But they are fun. School robotics club is a definite bonus
⁠>> print {Hey, RebolBot, do you see this?}
Let's see what this does ...
>> print {Hey, RebolBot, do you see this?}
 
; Brought to you by: try.rebol.nl
Hey, RebolBot, do you see this?
 
@johnk Sneaking any Rebol in there?
 
All lego mindstorms at the moment .. teaching a bit of view might be possible, as they are getting into scratch
Got to run. ttyl
 
5:52 AM
Np, later!
 
 
2 hours later…
7:50 AM
@earl I'm not sure what that demonstrates. Did you put return as a /local in a custom DOES?
 
8:23 AM
@iceflow19 in a way we do. If the process dies it send me a phone message.
 
 
1 hour later…
9:50 AM
@redbot
foo: func [return: [integer!]] [
    return "String should be invalid"
]

help foo

foo
 
; Brought to you by: try.rebol.nl

USAGE:

ARGUMENTS:

REFINEMENTS:
 
@RebolBot
foo: func [] []

help foo
 
; Brought to you by: try.rebol.nl
USAGE:
    FOO

DESCRIPTION:
    (undocumented)
    FOO is a function value.
 
I see Red doesn't error on return:, but it neither documents or enforces it at this time.
How should RETURN: be documented in HELP? It should presumably be the last thing; and if there was no specific information provided the RETURN section of help should be omitted.
@RebolBot
foo: func [a {Some documentation for a}] []

help foo
 
; Brought to you by: try.rebol.nl
USAGE:
    FOO a

DESCRIPTION:
    (undocumented)
    FOO is a function value.

ARGUMENTS:
    a -- Some documentation for a
 
9:57 AM
If you didn't override the typeset from "anything is possible" you don't get the list of all the types it accepts. (A parameter that accepts any type but unset! lists no types). For a RETURN: section, if you choose to document it but not list types then presumably it should say RETURN: and then give the description if provided.
 
10:14 AM
Are people comfortable with RETURN-OF just being implicitly a TYPESET! ? @rebolek suggested that wasn't confusing, though it is different from WORDS-OF vs TYPES-OF reflectors, and it would mean there isn't really a good way to get at the definitionally scoped return word itself. Maybe you shouldn't be able to. I dunno.
It seems to me having LOCALS-OF is actively harmful.
@RebolBot
foo: func [a {real parameter} /local b [integer!] {Why would typesets be allowed here?}] [
   print a
   print b
]

probe words-of :foo

apply :foo [10 true 20]
 
; Brought to you by: try.rebol.nl
[a /local b]
10
20
 
"Bad juju." (as @MarkI might say)
While wordy, I'd personally prefer PARAMETERS-OF and PARAMETER-TYPES-OF, then RETURN-TYPE-OF, and possibility omit RETURN-OF due to considering the definitionally scoped return off-limits.
There would explicitly not be a LOCALS-OF or LOCAL-TYPES-OF, and apply and function calls could not inject locals.
PARAMETERS could be shortened to PARAMS without too much loss, I still don't like abbreviation like that in the language.
 
10:42 AM
parameters of might be abbreviated to params-of
 
@pekr Mentioned right above, and yes, I just am a little hesitant on abbreviations.
But in that case, I think even in chat or conversation it is rare anyone writes out "parameter"
params-of / param-types-of
And if you're going to get wordier, it could even be parameter-typesets-of :-/
My remark above about "Why would typesets be allowed here", the only way they would have meaning is if you pass in a /local refinement or use apply and pass in the locals, and you shouldn't be able to.
Greetings @RudolfW.Meijer ("with security")... you show up from time to time, but please ask a question so we can bump you to 20 for chat. It's easy to chime in with an answer, even on an old and/or answered question... or to ask one of your own
I still am completely baffled by the 52 upvotes on this:
52
Q: Avoiding recursion when reading/writing a port synchronously?

Shixin ZengAll port operations in Rebol 3 are asynchronous. The only way I can find to do synchronous communication is calling wait. But the problem with calling wait in this case is that it will check events for all open ports (even if they are not in the port block passed to wait). Then they call their...

 
11:21 AM
I reported it to StackOverflow and basically explained "that doesn't make any sense".
(Vouched for @ShixinZeng, of course, as not being the source of any gaming-the-system.)
@Arie Hey, you know Rebol?
>> print ["Then welcome," reverse {eirA@} "!!!"]
 
; Brought to you by: try.rebol.nl
Then welcome, @Arie !!!
 
@HostileFork @RebolBot I am a long time Rebol user / lurker and have high hopes for Red!
 
@Arie It's a critical time for lurkers to de-lurk and get in on the debates... consider this important vote (not that one's vote itself matters much, but it's just about putting the options on the table and make arguments ultimately weighed by DocKimbel, and he'll then ignore the votes and do what he thinks should be done. :-P)
 
11:36 AM
@HostileFork Precisely!
 
:-)
 
@Arie Past-Meets-Future (you may decide which is which)
 
@HostileFork - you seem to be almost alone person working some bits on R3. Well, Atronix is here too, doing their stuff and giving back to community. Maybe Earl doing something secretly. But - have you though, if it would not be better to be more active with Red?
If there would not be Atronix, would there be anyone else, apart from you, trying actively push R3 forward?
Let's now forget, how picky Doc might be accepting the contributions.
I know you are mostly C++ guy, so maybe R/S is not a good fit for you?
My point is, that although Red is still behind of R3 in terms of completness, it is constantly progressing and there is some related momentum.
 
@pekr DocKimbel and I disagree about a number of things on a foundational level. And in a way, a number of the critiques I might suggest apply to Carl also apply to him in terms of being in charge of a language project. I think the off-the-cuff style which was used to write Rebol (in lieu of well-thought-out formalism up front) is not improving with Red; if anything, it's getting more haphazard.
Which is not a "counsel of despair" - rather a suggestion that it's good to have supplementary plans and a research wing that is able to look ahead and sweep up some issues.
 
I think Red would benefit from the existence of healthy competition from Rebol. And the other way around, too.
 
11:49 AM
well, that is true. Level of compatiblity is just the same as between the R2 and R3 ... different here or there, but still mostly a Rebol ...
 
It does take all kinds to create things. There are ways of thinking and concepts I'd never have thought of in Rebol, and in Red. I'd probably have pursued other ways, left to my own devices.
 
otoh we are splitting forces. But I can easily understand, that it is best for ppl to work on whatever they prefer, that's perfectly fair ...
 
Red is in serious danger of adopting bootstrap as a goal far too early.
 
what do you mean by the bootstrap? Writing Red in Red?
 
Yes.
A good, stable, improved and open source Rebol3 would offer several benefits.
 
11:53 AM
Right now, according to Altme, Doc is considering some libraries for events, as an inspiration/rewrite into R/S. It seems the model is going to be similar to libuv
 
I believe that Red needs to go through a port phase to open source Rebol prior to bootstrap.
 
I would not fear bootstrapping anytime soon. There's still lots of work towards 1.0, and even in areas not solved by R3 - concurrency for e.g.
 
So among the fixes of Rebol is going to be sorting out any things causing misgivings about the open source Rebol.
So the indexing compromise, for instance, has to happen. DocKimbel doesn't like foo/0 being what he thinks of as foo/-1. I don't like it either.
It may seem dumb, but the inability to mobilize on this stuff is what blocked the Rebol3 port of Red I had pretty far along.
Because--already concerned about performance--DocKimbel wasn't going to tolerate first-back foo as an abstraction which would run foo/0 in Rebol3 and foo/-1 in Rebol2. It was a deal-breaker because he wanted to write foo/-1 and would settle for no less; based on beliefs both aesthetic and performance-based to avoid the function call.
So he said no to any changes that would go about finding foo/-1 in Red source and turn it to first-back foo just for the sake of building on Rebol3. He already liked Rebol2 better and felt it fit his interests. And being built on closed-source for a moment wasn't a problem because he would bootstrap and it wouldn't matter.
Aspects there are reasonable; and the most unreasonable thing is why Rebol couldn't fix its mistakes.
Anyway, a strong and well-thought-out Rebol doesn't hurt Red. It helps it.
And Ren Garden / RenCpp doesn't hurt either. It helps.
 
12:31 PM
Considering how fast the world is moving with respect to IOT and App building I think it is very important that Red escapes the "lab" asap. So far I only could help with a few bug reports :-( How can we improve sp33d of development?
That said, it also matters very much that the 1.0 of Red is very stable and usable.
With regqard to Rebol3 I hope that its developers would join forces with Red, which would definitely be the better bet of the two.
 
@Arie Having more than one implementation of the same spec is good for many reasons. And not everyone interested in the language is going to care about the "full independent toolchain" - some users may be forbidden from bringing in things quite so foreign. So really joining forces is about solving the common questions applicable to both.
 
Regarding the discussion of case insensitivity I really think that breaking with the past should be no problem, if and only if the quality and the effect of "least surprise" (for new developers / coming from other languages) can be accomplished!
@HostileFork In that case it would be bad if syntax diverses ...
 
@Arie Making Red go faster is tough; DocKimbel is on a very particular wavelength about how to see things done. There will be few people who can read his mind well enough to make a good contribution. Bug reports are actually one of the best ways to contribute; but even moreso, working through interesting demos or bindings and helping pave the way from the user perspective.
 
Is there a comprehensive set of test scripts already?
 
@Arie I'd settle for LOAD compatibility; such that the same strings of source can be tolerated and built into structure. The more the two languages have in common after that, the better...but not as critical an issue.
@Arie Yes, and commits are not taken unless they pass the test suite which is part of the repository: github.com/red/red/tree/master/tests/source
 
12:39 PM
@HostileFork If case sensitivity would diverse it would become complicated to run programs on either platform...
 
@Arie It's likely to be difficult anyway, but yes, I think the case-sensitivity rules should line up.
And moreover, I am opposed to case-sensitivity for words, as I've said.
@Arie Tests are another place where contributions could be easier and more welcomed
 
@HostileFork I agree with that last quote ;-) (regarding cs words)
 
Anyway, just hanging around and doing Q&A and helping people make the work more public is good too. Hard to coax some people off their Usenet or Altme into the StackOverflow world, but the more people who get convinced I think the faster things go and the better the institutional knowledge gets.
@Arie But anyway, I've got to run... yet one good thing to do with Red is to try making something with it and see how far you can get. Quite some time ago I sat down to make dungeon.red as a solution to a puzzle I'd posted. I think more such things are important to have around, be kept working, etc.
Thanks for coming to chat--come back whenever, it's nice to keep momentum and have people around talking about stuff to share information and be semisocial :-)
TTYL...
(Sidenote: is there a better way to annotate that something should have no return value than return: [unset!]? Not that there's anything wrong with it in particular, it's consistent.)
@RudolfW.Meijer Upvoted your answer, one more upvote and chat should work for you...
 
1:02 PM
@RudolfW.Meijer Welcome!
 
@RudolfW.Meijer Chat server reputation propagation from the main site can take a little while, so just wait a while. :-) Less than an hour.
Zzzzz
 
1:29 PM
Thanks for all the encouragement. SO now presents me with one more channel through which to contribute to Red's improvement. I already use Google Groups and Github (where I masquerade as meijeru). It is not obvious how to distribute one's comments over these three channels according to the content: technical issues with the current implementation, general design issues, and promotional work.
 
Chat is still a chat - it is not threaded and scrolls away. Generally, for the userbase, google groups are imo the better option. For devs, SO dedicated channel might the the right answer. But - for general design questions, somewhat related to both Rebol and Red, this channel might be the right one ...
 
 
1 hour later…
2:50 PM
Having followed this chat for some time now, I want to voice my worry about the dispersion of effort over both Rebol(3) and Red. Some may find beneficial a healthy competition between the two
, but I would much rather see a concentration of the available effort and talent on Red only, and this for two reasons: (1) despite Rebol3 now being open, and the ticket traffic being lively, its development does not seem to progress (last commit on Github: Mar 4, 2014) whereas (2) Red is being ever more actively pursued, albeit with too few people.
 
@RudolfW.Meijer I see all progress as progress, and not just because I see Rebol and Red as one thing.
Moreover, I don't see "lack of concentration" as the real problem, if there is a real problem. But I am possibly misunderstanding you ...
 
@RudolfW.Meijer - FT (Fullstack Technologies) has 2 full time employees - Doc and Qtxie. Doc is looking for some other new persons to hire. Sadly, noone experienced from the former Rebol community is availabe for hire ...
e.g. Qtxie is perfect match for Red. So, I can understand Doc, that he gave up on recruiting old time rebollers and new hires will most probably come from the chinese community ...
 
@Markl But they aren't one thing. There are -- unfortunately -- subtle differences owing to different design decisions (all very defensible, for sure).
 
Well, I would not call Rebol and Red competting, it is a positive influence of @HostileFork on my point of view, that both might benefit one from each other, but - in a long term ...
4
The other thing is, that for at least 2 years now, we know, that if there's no active collection of maintainers of R3, Red is going to inevitably take over the active lead. And the gap of missing functionality is closing ...
 
@pekr Seen from the outside, they are competing on the same playing field. There may be no active maintainers of Rebol3, but there are quite a few people finding issues, proposing design and/or implementation changes, and all that intellectual effort could be directed at Red...
 
 
1 hour later…
4:15 PM
@RudolfW.Meijer Welcome to the chat rooms, Rudolf! I'd raise technical issues with the implementation as Github issues, discuss design issues in the chat rooms and on the mailing list (chat rooms for more immediate, chatty discussions; mailing list for deeper topics with a slower, more reasoned mode of communication), promotional work is probably best discussed on the mailing list as well -- or in the chat room, for quicker feedback.
 
Well, I am not sure. While I am not C level devoler, I doubt that any experience from Rebol C sources is going to be usefull for the Red/System. The architecture is imo quite different already and it surely is not about just a simple rewrite of C to Red/System ... just my amaturish point of view :-)
And once Red goes towards the concurrency (just recently Doc is studying available event mechanism libraries), it will differ even more, more so, once Red comes with the concurrency, which is almost inexistant with the R3 ...
 
@pekr Note, however, that the current event loop investigations don't have anything to do with concurrency.
At this point, it's "just" about aysnc / non-blocking abstractions for all kinds of I/O (and, possibly, some GUI subsystems).
@HostileFork It demonstrates a working, native implementation of definitional RETURN.
 
Earl - I know it does not. Re concurrency - that's just another area, where Rebol never properly got (at least I think we can't regard R3's task! type as a finished one, both design and implementation wise)
 
@pekr Yeah, absolutely. It will be interesting to see where Red goes in that aspect.
 
@earl - how's your project you demoed in Brno doing? :-)
 
4:22 PM
@pekr Sleeping! :)
 
well, good things need to brew for some time :-)
 
I wish I'd had more time for actively brewing those things, lately.
 
re concurrency - in the past, some ppl suggested to look into Erlang as an example, but surely there's much more to be inspired with out there ...
 
Yeah, I also think an actor model probably is pretty much the best we can do, given the current language mechanics.
 
that's what I remember Doc thinks too ... the actors ...
 
 
1 hour later…
5:27 PM
@RebolBot
does: func [body] [
    obj: object [return: func [val] [print "Definitional RETURN called!" val]]
    lib/does bind body obj
]

return: func [val] [
    print "Dynamic RETURN called!"
    lib/return val
]

code: [return 42] print do does [do code]

print do does [return 42]

return 99
 
; Brought to you by: try.rebol.nl
Dynamic RETURN called!
42
Definitional RETURN called!
42
Dynamic RETURN called!
== 99
 
@earl So I didn't know you'd done it natively; it didn't demonstrate that. But if you did, then that means you'd have a shot at doing things like type checking the return values even if a function didn't explicitly call return... sort of. But tacking another /local on is sweeping under the rug issues of hiding these things from the consciousness of APPLY and such for injection.
My way might be "harder" but I think it's work that needed to be done anyway.
And if by "making it actually work" you meant you didn't put the stack series in and all, then um... ok. :-)
 
@HostileFork Nah, it works.
"Making it actually work" refers to sorting out the hacks it builds on.
In particular the /local issue, which is definitely sweeping things under the rug, but just a quick attempt at getting the core thing going. Another thing is how it looks up the existing RETURN native.
@HostileFork It's work that absolutely needs to be done, eventually. Fully agreed. It's just that there's quite a bit of work that's not even properly designed yet, and I personally don't want to get tangled up in this as I think it's things that can bet tackled separately.
@HostileFork Yep, it's native. And it actually really RETURNs, contrary to the above mezzanine example :)
 
@earl Ok, but I meant it doesn't show passing through a stack level and returning from a function higher in the stack...
 
@HostileFork Right, it doesn't.
>> code: [return 42] print ["Expected 42, got:" do does [do code 99]]
 
5:41 PM
; Brought to you by: try.rebol.nl
Expected 42, got: 42
 
>> print ["Expected 42, got:" do does [return 42 99]]
@RebolBot alive?
 
@RebolBot Then kindly do your work, please!
 
@earl Are you worried about someone elses work please ?
 
>> print ["Expected 42, got:" do does [return 42 99]]
 
5:43 PM
; Brought to you by: try.rebol.nl
Expected 42, got: 42
 
The example just demonstrated that these two cases still work. The first one still via dynamic RETURN as a fallback, the second one using an actual definitional RETURN.
 
It's a little confusing
I was wondering if return should have that fallback or not.
Or if it does, if it should be called something else.
 
I'm not too convinced that dynamic RETURN is still needed.
 
(Searches thesaurus for RETURN...)
 
But it's part of the proposal with the most consensus so far.
 
5:49 PM
I don't have a problem with it existing, but I do have a problem with calling it return.
 
People (@BrianH, in particular) insist that it is somewhat common in PARSE rules.
If it's not called RETURN, I fear that will only make things much more confusing.
Because then you'd have to actually understand what is going on to decide which one to use. I think that understanding is fairly technical and something that I don't think should be imposed on users.
 
Well @BrianH isn't around... you snooze you lose. :-) So maybe we try without dynamic for a while and see what problems arise?
 
IIRC generating hf.com didn't invoke a dynamic RETURN, so there's that :)
The testsuite actually uses it twice, haven't yet looked where and why.
Probably as part of the elaborate error detection wrapper that is necessary in the test suite to actually handle failing tests.
(Gotta eat something, BBL.)
 
@earl I would rather an unbound return let me know and error, personally.
@RudolfW.Meijer Seen from the outside, they are competing on the same playing field. I don't think it's true; there may be slight truth that from the Red side there is a wish for Rebol to just go away. I think that would be bad for all kinds of reasons--Red is a tough word to "own" and being able to find Red through Rebol offers another vector for getting into it. And if anyone perceives a rivalry, that gives it some drama and newsworthiness...getting people more emotionally involved.
@RudolfW.Meijer "there are quite a few people finding issues, proposing design and/or implementation changes, and all that intellectual effort could be directed at Red" If you believe this, try making a creative exploratory proposal about changing something on Red's GitHub issue tracker. Watch it get closed pronto. It is simply not the case that the kinds of contemplations or redesigns being examined on the Rebol side are welcome in Red at this time.
Could we all stop working on thinking through interesting language designs, formalisms, and aesthetics beyond what was frozen in time in Rebol2, and submit small patches fixing bugs to a tightly controlled GitHub and play a minor role in Red? Sure. I personally am uninterested in that. If these languages are going to be relevant they need to offer a unique ergonomic balance... and Rebol2 didn't reach the necessary heights or coherence.
We think ahead. When the time comes, it will be Red's option to borrow the ideas that worked out. But there have to be ideas tested to try with. Should those ideas and experiments be done as adaptations to Red instead of Rebol? Well, that would sacrifice one of the testbeds for ideas...namely existing practical codebases. And it means foregoing analysis tools like Valgrind, or debugging tools and C IDEs, or (for me) leveraging small #ifdef'd portions of C++ to do global coherence checks.
 
6:14 PM
@HostileFork @RudolfW.Meijer If nothing else, if Rebol 3 can meet its potential as envisaged here, then it'll force Red to be better.
2
 
^-- A large part of my plan.
Sigh. Go and change one little thing like making the stack actually start empty and rebalance to empty at the end, and it's like suddenly all the code has to be correct... what a drag. :-)
For those interested, in the guts of something like Do_Next the contract is that after the operation is complete, you have one more stack value than when you started. So if you have an empty stack to start with, and then Do_Next([10 + 20 7 + 7]) you'll have one entry on the stack holding 30, and the stack pointer will be bumped up by one.
All values on the stack are safe from the GC, so if that were a string or something and a GC happened everything up to the stop of stack is safe. But anything above that which has been popped (or if it's an area never used) is considered dead to the GC, it ignores that.
Yet many other routines do something creepy and have warnings about it, which is to intentionally pop the stack and then by contract say the result is held the next "dead" value. Lots of exclamation points and saying "WARNING: Extremely volatile! If you do anything that might trigger a GC or cause another stack push then the value could go bad! Use it quickly, as it's in unprotected space!"
Which can leave you scratching your head going "Um, why is that the contract?"
It's a misguided implementation of how to prevent the caller from "worrying" about needing to balance the stack. If they're not going to use the result, then they can call the routine a lot of times without having to pop the stack each time...and there's no accumulation.
I've redone it so that the routines all use the result-on-top-of-stack convention, but I wonder if everything that does this should have a naming convention helping realize that's what it does? For instance: Push_Do_Next
That means the caller can see more clearly that they have a responsibility to at minimum do a DS_DROP ("data stack drop"... e.g. just decrement the stack pointer) if they want to ignore the value.
 
6:53 PM
@earl I think that understanding is fairly technical and something that I don't think should be imposed on users. ... well this is why having something with a weird name that only advanced people who understand would even know about wouldn't bother me. There's a lot of functionality out there that if you don't understand it, you shouldn't use.
 
7:19 PM
@HostileFork Problem is that, currently, this is very basic functionality that's easy for people to get right.
Pity that @BrianH always is so short on examples, I guess I'll have to whip one up myself.
But first, a minimalist "return capture" example:
@RebolBot do
my-do: func [code] [do code]
print ["Expected 42, got: " do does [my-do [return 42] 99]]
 
; Brought to you by: try.rebol.nl
Expected 42, got:  99
 
'>> my-do: func [code] [do code]
'>> print ["Expected 42, got:" do does [my-do [return 42] 99]]
Definitional RETURN called!
Expected 42, got: 42
So here's an example for (with definitional RETURN) passing through a stack level and returning from a function higher in the stack.
That you can't write a simple DO wrapper this way is probably quintessential #539.
 
@earl Very cool. In any case, I think this bolsters my "kill exit" argument, because having more than one of these isn't worth it return void is my leading suggestion. Even if \ or other unset literals exist, I don't think return \ is a good idea.
 
@HostileFork I'd rather get this working for RETURN and EXIT, and have this discussion separately.
That said, I tend to agree that the continued existence of EXIT as return #[unset!] shortcut is debatable. I'm not too fond of return void, though. Simply because "void" is not a name that exists anywhere else in the language, at the moment. And I'm not sure that introducing it as an alias for an unset! value is worth it.
 
7:37 PM
I wanted it to be return unset and then rethink the unset-as verb
Deemed too radical
 
return unset is nice. I fear that UNSET as a verb is nicer, though.
We really need to build a basic Rebol code indexer along with a basic tree query language.
Or someone!
>> type? do does [return ()]
 
; Brought to you by: try.rebol.nl
== unset!
 
So return () works, works already, and looks "ok" to my eyes.
One possibility.
 
Hmm, not terrible. Makes me wonder if in the grand copy-on-write series universe if all empty series might just be clones of the same series initially from empty archetypes.
I could go for that. Problem is that people might misread it and think that it's returning an empty paren block...
But sometimes with things like that, it's like the sooner you know and are exposed to the idea, the sooner you start getting the logic of the system.
Kind of like why I wanted if (foo < bar) {Hello} and to tolerate either foo < bar (some code) (some other code)
It's like it's worse to try and handcuff people vs give them the choices.
 
7:49 PM
>> if (10 < 20) {Hello!}
 
; Brought to you by: try.rebol.nl
== "Hello!"
 
"Kind of like why I wanted (and got...)"
 
Definitely good that we have that now. Even though I regularly forget that we do have it already :)
 
@earl Most people seem to like it, and the fact no one has complained indicates it must not be messing people up to be there (any more than anything else is skydiving without a parachute already). So if people can put a bug in DocKimbel's ear about it that would be good... he was skeptical of it.
I think it's definitely beneficial in helping new users map out the language properties at a very early time and "get it"
 
8:28 PM
Random remark: I think OPTS_LOCK and OPTS_HIDE should probably be moved to word's (and related types) "extensions" flags.
 
@earl If extensions is understood to be type specific, or something like that, then sure.
 
@HostileFork As far as I understand, "opts" is intended for flags applicable to all (or at least N>1) types of values. Whereas "exts" is datatype-dependent.
 
Sounds fine. Then OPTS_UNWORD belongs in that list (and needs a better name). OPTS_TYPEDSYM or something.
WORD_EXT_TYPESET
 
WORD_EXT_TYPESPEC
Yeah, something like that.
Or WRD_...
 
 
1 hour later…
10:10 PM
set-word!s as function attributes certainly look awkward for flag attributes.
'>> foo: func [transparent:] [return 42]
 
@earl Yep. I wondered if issue would be better.
 
@HostileFork My hunch too.
Issue is a bit noisy, though.
'>> foo: func [#transparent] [return 42]
 
But you get into the question of if transparent: true and transparent: false and transparent: some-logic-var would be better.
 
(And there's this potential contention with pre-processor usage which I don't now if we care about.)
A tag would actually be nice, for flag attributes.
'>> foo: func [<transparent>] [return 42]
And plain words in a paren another idea.
 
There's some advantage to not using a word type when no word is being made
 
10:15 PM
'>> foo: func [(transparent)] [return 42]
 
As COMPOSE-breaking concepts go, that doesn't seem to have enough payoff
 
Looks nice :) But, right ...
 
The tag is not bad, even if it means a hardcoded string compare...but how different is a hardcoded string compare from a hardcoded symbol compare anyway.
Very small performance hit.
 
Could also eventually auto-intern select strings.
'>> f: func [transparent:] [return "transparent"]
'>> f
** Throw error: return or exit not in function

'>> source f
f: make function! [[transparent:][return "transparent"]]
 
Unsure if I'm convinced on the name "transparent"
It sounds too image-domain vs. function-mechanics-domain
 
10:21 PM
func [point-of-no-return:] []
 
Yeah, had TRANSPARENT as a GUI word already.
Better names welcome. transparent is also rather annoying to type.
(Badly <s>balanced</s> distributed on qwerty)
 
I feel like also it sounds like TransMeta or some kind of "beyond parent" (if trying to interpret its meaning in functions/methods)
 
single-exit
fallthrough
Unfortunately, no really good names have come up so far :/
 
<unwind>
 
10:25 PM
More concise, but meaningless.
Only topped by R2's "throw".
Maybe best to just invent something artificial.
<noret>
Heh ....
...
Of course!
 
Without having fully studied the examples here, what happens if such a function returns a value just by having it be the last thing? Is that value ever visible?
 
<only>
@HostileFork Yep, that's returned.
Such a function just never has its "own" RETURN function.
(And doesn't catch dynamic RETURNs either; if they continue to exist.)
 
It seems like not mentioning the word "return" is probably bad. <no-return>
Or perhaps just tying it into an attribute you give return. return: false / return: off
 
If we get return-type specification via a return: attribute, that'd be problematic, no?
Also sounds a bit as if the function did return nothing (esp the <no-return> variant).
 
It's not a typeset.
 
10:32 PM
Yeah, but has the potential to make the dialect rather messy, I think.
return: off [integer! string!] doesn't flow too well. Nor does return: [integer! string!] off.
 
@RebolBot
foo: make typeset! [integer! string!]

bar: func [x [foo]] [print x]

bar "Hello"
bar "10"
bar <somestuff>
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-expect-arg.html
    Hello
10
*** ERROR
** Script error: bar does not allow tag! for its x argument
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
Mhm, that works. As do types referred to by any other word.
 
@earl Hm. Well, there is the question of wanting to check the evaluation type vs. having a return type.
 
>> int: :integer! foo: func [x [int]] [x] print foo 1 print foo "bar"
 
10:36 PM
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-expect-arg.html
    1
*** ERROR
** Script error: foo does not allow string! for its x argument
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
Maybe you shouldn't use return: with this kind of function, but use a different word? :-/ final: [integer! string!]
To indicate that the only thing you can specify is the result of the final evaluation, or something?
Then check the spec to make sure both return: and final: aren't used.
 
Unified return-type specification via return: seems rather sensible.
Once we get there.
 
Perhaps focus on the idea that the function must complete to the end? <all> Well, I guess that's not true since you use other people's returns.
 
Thanks, but I'll <pass> return along.
 
<passthru> is better than <transparent>
<pass-return> is more explicit. I don't know if it's so common that being clear is a bad idea.
 
10:47 PM
Not sure if it's that much clearer.
<passthru> and <pass-return> are in any case much better already.
 
The problem here being that in characterizing it, speaking of how it's different instead of how it is the same seems more helpful. All functions will passthru bound returns. The difference is not having a bindable return of its own
<unbound-return>?
 
<no-bound-return>
 
Wordy but at least informative.
<no-return-word>
 
With dynamic return, it also doesn't capture any kind of RETURN.
I think we'll best stick with <point-of-no-return>.
 
Heh. That sounds too much like DEAD_END; or otherwise saying the function is in a FOREVER loop and you shouldn't expect it to ever return a result.
 
10:53 PM
j/k :)
That's also how I'd interpret <no-return> at first glance, btw.
 
I guess <passthru> is probably best so far.
It's short, it can be looked up for what it means, it's not <transparent>
 
<nbr>
<nrw>
(no bound return, no return word)
(Not North Rhine-Westphalia!)
 
no line break
<nra> no return available
 
<nlr> no local return
 
(And if you don't like that idea, you might get shot)
 
11:11 PM
<↖>
 
@earl <escape>
 
11:41 PM
'>> g: func [<passthru>] [return 42]
>> g
** Throw error: return or exit not in function

>> f: func [] [g 99]
>> f
== 42
Dynamic return as a fallback at work.
 
Hmmm
Well, I still want to see the examples of why dynamic return does more good than harm
 
Maybe shoot @BrianH a message if he has any concrete PARSE examples at hand.
From looking at a few of my more complex parse usages, I don't have any of that.
>> source USE
 
; Brought to you by: try.rebol.nl
USE: make function! [[
    "Defines words local to a block."
    vars [block! word!] "Local word(s) to the block"
    body [block!] "Block to evaluate"
][
    apply make closure! reduce [to block! vars copy/deep body] []
]]
 
>> f: func [x] [use [] [return x] "Wrong!"]  f 42
 
; Brought to you by: try.rebol.nl
== "Wrong!"
 

« first day (1651 days earlier)      last day (2129 days later) »