« first day (1739 days earlier)      last day (2041 days later) » 

12:00 AM
I was thinking that ensure x would be like an assert x that evaluated to x if true. This could be ensure/default x [...]
Wordy, but it's hard to imagine a single word that would convey the idea.
 
12:28 AM
The parse approach above offers interesting opportunities, in particular solving the overly aggressive need for shorthand of pos: and :pos, making it easier to accept those being turned into mark pos: / mark pos and seek pos
>> parse "abbbccccd" ["a" print [some "b" some "c"] "d"]
bbbcccc
== true
>> parse "abbbccccd" ["a" print some "b" some "c" "d"]
bbb
== true
And with expression barriers...
>> parse "abbbccccd" ["a" \ print some "b" \ some "c" \ "d"]
bbb
== true
If it's too hard to tell the difference from keywords, it might be that get-words serve the purpose of letting you point out when something is explicitly not a keyword. parse "abbbccccd" ["a" \ :print some "b" \ some "c" \ "d"] Previous aesthetic arguments have said that such disambiguations should be used restrainedly in dialects.
 
yes, that would make it clearer
 
Okay, so now I see how BREAK and CONTINUE need to be interpreted. CONTINUE needs to kick you to the next alternate, BREAK needs to leave the optional rule group you're evaluating and go to the next match. BREAK meaning "accept" makes sense in the sense that break in a loop means "we're done here, move on"
CONTINUE meaning "this piece of the segment is done, go to the next segment"
 
1:23 AM
One issue would be that if you permit function values, what happens if you stack them. No technical reason you couldn't. :print :keep some "b".
Essentially, make a matched function result itself count as a match of the value of the result.
Though that is problematic, as in the case of KEEP, if keep returns a value you don't want the kept value to be applied as a rule. So the matched function results could fulfill function arguments with the result of processing, while not being rules themselves. A bit dodgy, perhaps best prohibited.
This model for treatment of functions is contentious with the idea of functions being evaluated and then placing their results inline as rules.
 
2:10 AM
In general, a function invocation probably would have to be transparent, the way parens do not return results. parse "abbbbc" ["a" some "b" (print "hi there" "c")] doesn't let the c participate in the match rule just by being a residual. A function value in parse used in the style described has more in common with a paren! than with a function whose mission it is to inject a result
Though I think the break/with and continue/with provide an interesting option for doing so explicitly, and a function could have a similar option. If it bubbles up a break or continue /with, then that could be used as a rule.
However this does not fit very well with the idea of functions with refinements as character set generators; because such a generic function would not return its results to ordinary Rebol usages via "break/with".
Perhaps character sets need to be lazy initialized by their nature.
This would make defining them cost less because it would only be the first usage of them that turned their spec into bits. They could also be collapsed back into their spec by the GC if not used after a while.
 
 
2 hours later…
4:20 AM
@GrahamChiu stackoverflow.com/questions/31823358/… I'm sure you can guess why I am asking this one :-) It is surprisingly hard to find any useful http cookie handling examples in the rebol3 world with the exception of your work
 
@johnk (GrahamBot is looking for the answer...)
 
I use a modified R3 http protocol to do this stuff
 
@GrahamChiu on this line is result just a (binary) string? I was after the cookies as well as the body :-/
 
4:48 AM
@johnk I added a debug word to the protocol to allow for this
 
1
Q: How do I pass a URL a cookie using Rebol 3 and get the response cookies?

johnkThis stackoverflow question - How do I pass a URL a cookie using Rebol 3? - almost answers my question, but I am not sure how to capture the cookies from the response. What I would like to do is call to a URL passing in cookies (and headers) and to be able to view the response and the cookies (a...

 
ok, so using your http protocol would it be something like this?
site: rebol.com
write site [ GET [ Cookie: {test=1}] debug ]
(if so, I can go and answer my own question :-)
 
oohhh... no
I can't remember and I didn't document
Looking at the code, it seems if you add a 'headers word to the http dialect, and you get an error, then my protocol returns the error object containing a debug field
but that's not helping you because you're doing a post without an error response
Or, it may :(
when you login to stackoverflow, it redirects you
which currently prot-http considers an error
Does that help?
 
5:06 AM
@GrahamChiu not this time as I am after the chatusr cookie which you get when you pass all the cookies from the login page response back to the chat page (not forgetting to collect the chat fkey on the way)
 
and this is not sent in the content I take it
 
@GrahamChiu I don't think so as it is in the headers whereas the fkey is in the body (but it is a pain to debug so I am not completely sure)
@HostileFork pasting cookies into the console is a valid use case for having multi line support working. I have been known to reduce the font point size to 3 to quickly paste in a cookie
I will get back to playing with this tonight - can't chat much more as I am working now
 
@johnk I'm not against it. I think the only thing we are against is including ncurses and such. But as I said, a quick clone of what Red does, if people would like that, wouldn't take long.
 
can you try to see what happens if you use the dialect with 'headers
`
write site [ HEADERS GET [ Cookie: {test=1}] ]
 
@GrahamChiu Great. I will do later tonight when I am back at my dev machine
 
5:13 AM
I have no idea why I didn't document what I was doing here
 
It highlights to me that we should prioritise improvements to the http protocol. Hopefully this is something we could align with Red as I understand that it is also high on DocKimbel's list when IO support is in place for Red
bbl
 
here it says it sets a debug flag to true if headers is encountered in the write dialect github.com/gchiu/Rebol3/blob/master/protocols/prot-http.r3#L217
and here github.com/gchiu/Rebol3/blob/master/protocols/prot-http.r3#L49 it says if the spec/debug flag is true, don't return the body but return the locals which includes header and body
So, I'm hopeful that it should work like that :)
I clearly needed to look at the cookies returned when writing that script so I must have included a way to do this
 
5:44 AM
@johnk I've answered the question on how to get the cookies using my modified prot-http.reb
 
0
A: How do I pass a URL a cookie using Rebol 3 and get the response cookies?

Graham ChiuI do this using an http protocol that has been modified to return an error object with the info object when manual redirect required. The file is available at: https://raw.githubusercontent.com/gchiu/Rebol3/master/protocols/prot-http.r3 >> do https://raw.githubusercontent.com/gchiu/Rebol3/mast...

 
Not quite. The modified protocol adds an additional optional headers word in the write dialect, and on any error returns an error object containing the spec locals
Yes, an error is triggered on a redirect
 
 
7 hours later…
12:20 PM
I am wondering, it is now more than half a year from the capital injection in the Red construction company. Did anyone from this community receive an offer to aid in the development of Red? And if so what happened (rejected for having no extra time or other reasons) why the offer was not taken?
 
1:03 PM
And we are getting somewhere
in A room for Harold and Maude, 28 secs ago, by RebolBot
@johnk hi to you too
finally
@GrahamChiu interesting parts for you github.com/johnk-/Rebol3/blob/master/scripts/…
Instead of just using reform to flatten the cookie data I ended up with this - reform collect [ foreach cookie err/arg2/headers/set-cookie [ keep first split cookie " " ] ]
then I used your headers debug option to pull out the response cookie and appended it to the existing cookies from the login page.
 
1:45 PM
>> "I might just be alive"
 
; Brought to you by: try.rebol.nl
== "I might just be alive"
 
@RebolBot alive?
 
Thanks @GrahamChiu - she's alive!
 
2:20 PM
posted on August 05, 2015 by dram

Using current HEAD (7c0cdd7), Ren/C will throw "return or exit not in function" error after querying documents for more than once. Following is full transcript: >> ? foo No information on foo >> ? bar ** Throw error: return or exit not in function ** Note: use WHY? for more error information

 
2:51 PM
@johnk Thanks muchly to you both.
@HostileFork Aren't you thinking of ANY?
>> any ["abc" do [1 + 2]]
 
; Brought to you by: try.rebol.nl
== "abc"
 
>> any [false do [1 + 2]]
 
; Brought to you by: try.rebol.nl
== 3
 
 
4 hours later…
6:31 PM
@johnk great
@johnk so would you accept my answer as well :)
And are we going to use HF's r3?
 
 
1 hour later…
8:04 PM
@GrahamChiu If you mean for RebolBot, can we have both please?
 
@MarkI Ah yes, ensure any [ ] would work. Tx.
Interesting, above error report from someone-we-don't-know... (well, someone I don't know, anyway.)
 
@HostileFork You don't know them yet. Anyways, good to see people trying it out, I hope you agree.
And would it be possible pretty please to have RebolBot refresh its HF-r3?
Either whenever it's built, or via a Bot command, doesn't matter to me.
 
8:27 PM
@MarkI RebolBot uses the TryRebol service to run its queries (as opposed to trying to run them in-process, which could bring down the bot and would have all the concerns with timeouts/infiniteloops/etc. that TryRebol sandboxes). We've discussed the idea of having RebolBot go "independent"...or at least @earl suggested that running such a process wouldn't be a major effort.
Though it isn't really the "moment of setup" with something like that, it's more the "keeping it running". Which Kaj has been good about doing; it has stayed up consistently since its creation. And if it had the goal of refreshing the build regularly, then that would make it a bit more complicated.
 
@HostileFork I see, I forgot about that extra indirection. Well, if it can't be updated easily, then I'd say wait until HF-r3 settles down a bit first.
 
@Maarten I have managed to build Ren/C in XCode and get it under the debugger. As an IDE XCode does some interesting new things (side-by-side real-time view of git diffs while editing), but seems broken in other ways. Do you have XCode installed?
 
 
2 hours later…
10:20 PM
All right, so preliminary call stack chunked implementation is to lay it out in memory as [Next_Chunk_Ptr (Chunk_Left Prior_Call ....frame data....) (Chunk_Left Prior_Call ....frame data...) ....chunk remaining....]. Here the ( ) is a call frame, and [ ] is a chunk of memory.
If chunks are a known size, you can quickly get from any call frame to its chunk, and from that chunk to the next. It shouldn't be too difficult to make it so that you always keep one spare chunk for overflow. This prevents you from getting into a situation where you're in a function call, and then make a new frame which has to go into a chunk so you do an allocation... then you return and have to do a free... then you make another call and have to do an allocation... etc.
Ah, the joys of handwritten C data structures.
 
We've discussed this before, but I don't think we ever decided on where to store commonly used character sets for parsing.
Simplest is to make them globally available vs in a module
Perhaps we can analyse the sources of published R3 code to see what character sets are most used, and make them available?
 
10:38 PM
@GrahamChiu We haven't solved the problem until you can say parse "foo 3AC4" [some letter/lower some whitespace some digit/hex/upper]. Putting them in a module where you have to import them doesn't get us there, and anything that can't work with that syntax (or similar) is too unwieldy to give RegEx the thrashing it deserves.
 
sounds as though you still want functions there
we can use 'compose to use functions in a parse rule but it gets pretty unwieldy after a while
 
The alternative proposal for functions makes a bit more sense for PARSE, because you're not getting their arguments via DO dialect interpretation inserted into the parse. It fits better. By contrast, there's something misshapen about the "only allow you to call zero arity functions" rule, to avoid DO dialect from being in PARSE when it's not in parens.
And in practical trials of my function implementations, I felt the functions themselves were a bit oddball. Some kind of caching tail-wagging-the-dog thing.
If it were an object and we couldn't just say 'letter', we might pay a little more with letter/any
Not as satisfying as 'letter' :-/
But perhaps better than breaking the entire model of the system just for the feature of being able to say that.
Then do the caching as I suggested, automatically in the charset. Save the specs. Generate bits on demand. If bits haven't been used in a while, collapse the charset back to the spec.
The main element of lack-of-perfection there is 'letter' vs. having to say 'letter/any'. Do I hear a better idea?
One might argue that the /any could be a cue to remind you that there are other types of letters, and you might look at the help and go "oh my, look. Unicode classes. Which did I mean?"
In fact, arguably most people mean letter/latin-8, and should put some kind of qualification anyway.
digit/decimal is more clear than digit. What would we choose as the defaults anyhow? And why?
 
why not just make common charsets part of the parse dialect?
so, your refinement is not calling a function, but is also part of the dialect
 
10:54 PM
@GrahamChiu Because that's a terrible idea. :-) PARSE operates on keyword symbols, it would have to make them up, DocKimbel would freak because it's one more case in the switch statement or jump table or whatever. It's rather arbitrary.
 
It can't be terrible because I like it
 
Heh
@GrahamChiu When I've tried using that philosophy, people have objected.
I think this is a case for pushing on charsets some, and on module systems and objects some.
 
When you define a charset, that's what you're doing anyway
you're adding to the parse dialect
 
Defining a parse keyword? No.
The word and what it is bound to can change during the course of the parse. So you're not adding to the parse dialect.
 
whereas the parse keywords are immutable?
 
11:00 PM
@GrahamChiu Quite so... their symbol numbers in fact, compiled in as constants.
Critical for performance.
That list may or may not be optimized to a jump table. I should check. Probably was at some time, but may not be now. (Basically every C compiler, even very old ones, will look at your switch cases, and if they're sequential then it will use a jump table instead of if...else if... else if. Modern optimizers will look for other opportunities, but that's a very old optimization.)
 
we already have some creep in my suggested direction
space was not in the original parse
 
It still isn't. SPACE is a word looked up to a character.
Ordinary variable.
 
hmm
Well, I still say make digit, alpha, dot and whatever else I can't think of at present as part of parse :)
you can always change the implementation later on
 
11:18 PM
@GrahamChiu Not always.
@RebolBot Long time no see. You feeling all right?
 
@HostileFork Can you be a little more specific?
 
Ah yes, feelings. You would have trouble with that.
 
@GrahamChiu See if they'll send some of that $100 million to someone to do it.
Just $1 million would be enough.
 
I was hoping for more
 
Well don't show them this chat. I'm saying, if we have to go low, we do.
 
Don't need Amazon Echo, just a few Android devices scattered around the house to play HAL
Douglas Rain seems to be still alive. But I guess a bit creepy if they had used his voice.
 
11:52 PM
@johnk Good to have the bot back! Thanks!
 
@GrahamChiu moving the bot from atronix to the Ren/c build is on my list. I need to do a bit more testing (especially around the automatic re-authentication)
 
Is login automated yet?
 
Yes
But I have disabled automatic re-login just in case there is a problem. The code is in github commented out
 

« first day (1739 days earlier)      last day (2041 days later) »