rebol

Rebol Smallest Http Server in the World: why first wait listen-port?

▼魔方 西西 提交于 2019-12-07 19:31:27
In this code web-dir: %./www/ ; the path to rebol www subdirectory listen-port: open/lines tcp://:80 ; port used for web connections buffer: make string! 1024 ; will auto-expand if needed forever [ http-port: first wait listen-port while [not empty? client-request: first http-port][ repend buffer [client-request newline] ] repend buffer ["Address: " http-port/host newline] parse buffer ["get" ["http" | "/ " | copy file to " "]] parse file [thru "." [ "html" (mime: "text/html") | "txt" (mime: "text/plain") ] ] data: read/binary web-dir/:file insert data rejoin ["HTTP/1.0 200 OK^/Content-type: "

Rebol Quickstart [closed]

我怕爱的太早我们不能终老 提交于 2019-12-07 15:28:43
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I've been meaning to try out rebol (or red). I think it might be the perfect fit for my next project. I've downloaded and tested out red 0.5.4, and REBOL/View 2.7(http://www.rebol.com/download-view.html) However, there are a couple of roadblocks for a complete beginner to rebol:

How to mix together string parsing and block parsing in the same rule?

落花浮王杯 提交于 2019-12-07 09:51:25
问题 It's cool that Rebol's PARSE dialect is generalized enough that it can do pattern matching and extraction on symbolic structures as well as on strings. Like this: ; match a single "a" character, followed by any number of "b" chars >> string-rule: ["a" some "b"] >> parse "abb" string-rule == true >> parse "aab" string-rule == false ; look for a single apple symbol, followed by any number of bananas >> block-rule: ['apple some 'banana] >> parse [apple banana banana] block-rule == true >> parse

What's known about UTYPE! in REBOL 3?

梦想的初衷 提交于 2019-12-07 08:20:35
问题 The only information I can find on the datatype UTYPE! is "not yet been documented for R3" and "user defined datatype", still giving a shred of hope that I can break out of Rebol's canon of predefined datatypes and formulate the polymorphism of my functions in a more straightforward manner. Just... I've no idea how to deal with UTYPE!. Trying: make utype! <2nd-arg> with several kinds of arguments (including an object) was invariably leading to "Script error: invalid argument: <2nd-arg>". So,

Rebol Multitasking with Async: why do I get Invalid port spec

爷,独闯天下 提交于 2019-12-06 18:48:32
I tried http://www.mail-archive.com/rebol-list@rebol.com/msg19437.html (I just changed to www.reboltutorial.com) : do http://www.rebol.it/giesse/async-protocol.r handler: func [port [port!] state [word! error!] /local tmp cmd] [ if error? :state [print mold disarm state return true] switch state [ connect [ ; do HTTP request insert port {GET /files/2009/10/word.png HTTP/1.0^M^JHost: www.reboltutorial.com^M^J^M^J} false ] read [false] write [false] close [ ; get data data: copy port close port ;print copy/part data find data "^M^J^M^J" data: to binary! find/tail data "^M^J^M^J" other/image:

I thought this parsing would be simple

烂漫一生 提交于 2019-12-06 16:10:51
问题 ... and I'm hitting the wall, I don't understand why this doesn't work (I need to be able to parse either the single tag version (terminated with />) or the 2 tag versions (terminated with ) ): Rebol[] content: {<pre:myTag attr1="helloworld" attr2="hello"/> <pre:myTag attr1="helloworld" attr2="hello"> </pre:myTag> <pre:myTag attr3="helloworld" attr4="hello"/> } spacer: charset reduce [#" " newline] letter: charset reduce ["ABCDEFGHIJKLMNOPQRSTUabcdefghijklmnopqrstuvwxyz1234567890="] rule: [

Rebol GUI on Android Displays Too Small

半城伤御伤魂 提交于 2019-12-06 14:43:01
So I've discovered Rebol , and am thrilled that it runs on Android. When I create a GUI, though, the GUI first pops up with the top left corner in the center of the screen, and I cannot move or resize the window. If I rotate my phone to a horizontal display, the window resizes itself to the screen properly. Then I rotate my phone to a vertical display, and the window fills the screen properly. But everything on the window is minuscule--almost too small to interact with via finger taps. I haven't seen anyone else complaining about this issue. How can I fix it? I want the widgets to display the

How to get the response content of an HTTP 404 response

夙愿已清 提交于 2019-12-06 05:13:43
问题 Is there an easier way of getting the content of an HTTP 404 response than directly accessing the host via tcp? This is a sample of a 404 response with content: HTTP/1.1 404 Object Not Found Server: CouchDB/1.3.0 (Erlang OTP/R15B03) Date: Wed, 24 Jul 2013 08:32:50 GMT Content-Type: text/plain; charset=utf-8 Content-Length: 41 Cache-Control: must-revalidate {"error":"not_found","reason":"missing"} 回答1: The Rebol HTTP scheme really isn't designed with this in mind, it's geared toward reading

Rebol Quickstart [closed]

怎甘沉沦 提交于 2019-12-05 20:35:18
Closed . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 3 years ago . I've been meaning to try out rebol (or red). I think it might be the perfect fit for my next project. I've downloaded and tested out red 0.5.4, and REBOL/View 2.7( http://www.rebol.com/download-view.html ) However, there are a couple of roadblocks for a complete beginner to rebol: Red seems to be still in alpha so it is out of the question There seems to be 3+(?) branches: REBOL3

Why are the 'context' and 'object' functions in Rebol different, but essentially the same?

限于喜欢 提交于 2019-12-05 17:05:14
On the one hand we have: >> source object object: make function! [[ "Defines a unique object." blk [block!] "Object words and values." ][ make object! append blk none ]] For context we see: >> source context context: make function! [[ "Defines a unique object." blk [block!] "Object words and values." ][ make object! blk ]] So, for object the object is constructed from a block to which none has been appended. This doesn't change the length, or, to my knowledge, add anything. With context , on the other hand, the object is constructed with the passed-in block, as is. Why the difference and why,