« first day (846 days earlier)      last day (2934 days later) » 
00:00 - 23:0023:00 - 00:00

11:03 PM
So many improvements I could make to Rebmu's implementation now that I know more, aargh... :-) I guess I need to do so at some point.
I still think the dialect itself is on the right track.
Just needs parse-mu :-)
 
@BenjaminGruenbaum In Rebol, this is very similar, except we use blocks, not arrays/maps: From my example, you can separate the block from the statement:
file-types: [%.png ['image/png] %.jpg %.jpeg ['image/jpeg]]
file-type: switch file-suffix file-types
And then manipulate the block:
 
That's nifty :)
 
append file-types [%.gif ['image/gif]]
insert find file-types %.jpg %.jpe
You could even stick an anchor in there if you wanted to classify things:
file-types: [png %.png ['image/png] jpeg %.jpg %.jpeg ['image/jpeg]]
insert find file-types 'jpeg %.jpe
Almost anywhere you see a block, you can manipulate the content before using it:
my-block: either this = that [[do this]][[do that]]
if that = the-other my-block
 
11:22 PM
@BenjaminGruenbaum That statement "Almost anywhere you see a block, you can manipulate the content before using it" is hugely powerful. It's why if Rebol is missing something you think would be nice you just make it. ifnot: func [condition code] [if not condition code] and then you can say ifnot x = 10 [print "x isn't 10"] (Of course, there already is an "ifnot", it's called "unless", but if there weren't you could have made it if you wanted it.)
That's simple because you're just passing it through a variable, but even being able to pass things through that cleanly is an advantage. No lambdas needed, no messiness, it's all as clean as the original.
Then when you want to do manipulations on the block too... it gets cooooool.
 
why should this not be the default behaviour of 'if

fib: func [ b e [block!]][ if reduce b e]
 
@GrahamChiu As BrianH pointed out, sometimes series results like block are used as logical truth if find [a b c] 'a [print "a is in the set"]
 
11:47 PM
.I'd love seeing how parsing HTTP headers would work in Rebol
More generally, parsing an HTTP request
 
A taste of some built-in support for headers:>> http-port: open http://www.stackoverflow.com
>> probe http-port/locals/headers
make object! [
Date: "Sat, 23 Feb 2013 23:51:16 GMT"
Server: none
Last-Modified: "Sat, 23/Feb/2013/23:51:16/+GMT"
Accept-Ranges: none
Content-Encoding: none
Content-Type: "text/html; charset=utf-8"
Content-Length: "210945"
Location: none
Expires: "Sat, 23 Feb 2013 23:52:16 GMT"
Referer: none
Connection: "close"
Authorization: none
Cache-Control: "public, max-age=60"
Vary: "*"
 
This counts the number of times the word rebol appears in the REBOL frontpage html:
>> parse/all read http://rebol.com [(count: 0) any ["rebol" (count: count + 1) | skip]]
connecting to: rebol.com
== true
>> count
== 52
 
@Jina @PeterWAWood note that if you don't put URLs in backticks in single line messages, http://whatever.com winds up just saying whatever.com with the link. So you have to use backticks or put it in a multi-line messge...
Also that's R2 only for now I assume? Is there an R3 equivalent yet?
 
Is there any way to post code without SO interfering?
 
R3 is promising yet incomplete in many ways. R2 is a better demo of what R3 will be capable of in some areas.
 
11:58 PM
@PeterWAWood Multi line message made with shift-Enter (and potentially using the "fixed font" button. Or surrounding things with backticks, afaik that's it.
 
00:00 - 23:0023:00 - 00:00

« first day (846 days earlier)      last day (2934 days later) »