rebol3

How do I pass a URL a cookie using Rebol 3?

我只是一个虾纸丫 提交于 2019-12-05 11:09:01
Using R3, I need to get a localized version of a page from a website that uses cookies to handle this. In REBOL 2.x, I could do this: page: http://www.rci.com/resort-directory/resortDetails?resortCode=0450 read/custom page [header [Cookie: "USER_LOCALE=fr_FR"]] Based on the sketchy docs for R3, I should be able to do something like: result: write page [GET [Cookie: "USER_LOCALE"] {fr_FR}] Anyone have any ideas? The R2 method worked well, but since R2 doesn't handle UTF-8 needed for many foreign languages it's of little use to me here. ** Update ** The solution (restated) in R2 for my example

REBOL 3 - Where can user defined namespace words be accessed?

落花浮王杯 提交于 2019-12-04 07:48:17
Lets say I define a few words: Word1: 5 Word2: "blahdiddyblah" Is there some part or block of the system that stores which words are in use? Tried something like this but it failed: S1: to-block copy system/contexts/user D: 3 S2: to-block copy system/contexts/user Difference s1 s2 According to @johnk suggestion, I tried: >> snapshot-of-words: words-of system/contexts/user == [system snapshot-of-words words-of contexts user] >> x: 1 == 1 >> difference snapshot-of-words words-of system/contexts/user == [x difference] >> difference snapshot-of-words words-of system/contexts/user == [x difference]

What is the 'reword' function in Rebol and how do I use it?

梦想的初衷 提交于 2019-12-03 12:22:49
I saw someone mention the reword function today, but documentation for it is very brief. It looks like shell script environment variable substitution, or maybe regex substitution, but different. How do I use this function and what kind of gotchas am I going to run into? Here there be dragons! The reword function is a bit of an experiment to add shell-style string interpolation to Rebol in a way that works with the way we do things. Unlike a lot of Rebol's series functions, it really is optimized for working on just string types, and the design reflects that. The current version is a design

Avoiding recursion when reading/writing a port synchronously?

北城以北 提交于 2019-12-03 10:20:57
问题 All 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 responding event handlers, but a read/write could be done in one of those event handlers. That could result in recursive calls to "wait". How do I get around this? 回答1: Why don´t you create a kind of

Avoiding recursion when reading/writing a port synchronously?

好久不见. 提交于 2019-12-03 00:52:19
All 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 responding event handlers, but a read/write could be done in one of those event handlers. That could result in recursive calls to "wait". How do I get around this? Why don´t you create a kind of "Buffer" function to receive all messages from assyncronous entries and process them as FIFO (first-in, first

How to use IN with a block instead of an object?

落爺英雄遲暮 提交于 2019-12-01 08:26:37
The IN function in Rebol finds out if a field is in an object: USAGE: IN object word DESCRIPTION: Returns the word or block in the object's context. IN is a native value. ARGUMENTS: object (any-object! block!) word -- (modified if series) (any-word! block! paren!) The claim is it works with objects or blocks. It works okay if I try it with an object: >> in object [foo: 10 bar: 20] 'foo == foo But if I just try it with a raw block, it gives back NONE: >> in [foo: 10 bar: 20] 'foo == none Guess I'd understand if it didn't support blocks (Rebol2 didn't). But what's the case in which it wouldn't

Why does return/redo evaluate result functions in the calling context, but block results are not evaluated?

五迷三道 提交于 2019-11-30 09:26:46
Last night I learned about the /redo option for when you return from a function. It lets you return another function, which is then invoked at the calling site and reinvokes the evaluator from the same position >> foo: func [a] [(print a) (return/redo (func [b] [print b + 10]))] >> foo "Hello" 10 Hello 20 Even though foo is a function that only takes one argument, it now acts like a function that took two arguments . Something like that would otherwise require the caller to know you were returning a function, and that caller would have to manually use the do evaluator on it. Thus without

What is the summary of the differences in binding behaviour between Rebol 2 and 3?

爷,独闯天下 提交于 2019-11-30 07:01:56
The current in-depth documentation on variable binding targets Rebol 2. Could someone provide a summary of differences between Rebol 2 and 3? BrianH There isn't really a summary somewhere, so let's go over the basics, perhaps a little more informally than Bindology . Let Ladislav write a new version of his treatise for R3 and Red. We'll just go over the basic differences, in order of importance. Object and Function Contexts Here's the big difference. In R2, there were basically two kinds of contexts: Regular object contexts and system/words . Both had static bindings, meaning that once the

Why does return/redo evaluate result functions in the calling context, but block results are not evaluated?

安稳与你 提交于 2019-11-29 14:29:23
问题 Last night I learned about the /redo option for when you return from a function. It lets you return another function, which is then invoked at the calling site and reinvokes the evaluator from the same position >> foo: func [a] [(print a) (return/redo (func [b] [print b + 10]))] >> foo "Hello" 10 Hello 20 Even though foo is a function that only takes one argument, it now acts like a function that took two arguments . Something like that would otherwise require the caller to know you were

What is the summary of the differences in binding behaviour between Rebol 2 and 3?

烂漫一生 提交于 2019-11-29 08:35:25
问题 The current in-depth documentation on variable binding targets Rebol 2. Could someone provide a summary of differences between Rebol 2 and 3? 回答1: There isn't really a summary somewhere, so let's go over the basics, perhaps a little more informally than Bindology. Let Ladislav write a new version of his treatise for R3 and Red. We'll just go over the basic differences, in order of importance. Object and Function Contexts Here's the big difference. In R2, there were basically two kinds of