« first day (1015 days earlier)      last day (2765 days later) » 

12:12 AM
@AstDerek I've coded quite a bit in PHP (by necessity for a long-running contract job). After programming in Rebol, it's like dragging your fingernails down a blackboard. ;-p
 
Red 0.3.3 is out! bit.ly/15oVXfv
4
 
@Respectech Learning Rebol without knowing Ruby at least is like trying to wake up from the bed and realize you are still dreaming
 
@DocKimbel Congratulations! Thanks for the link too... and, um, my website is apparently down. I'll get on that.
 
@HostileFork Thanks! That's the least I could do. ;-)
 
12:28 AM
@AstDerek 'if takes a truthy value, and not a block
 
I wish I could use @rgchris's code coloring tool in my blog articles...I really need to drop Blogger...
 
I find the best way to red the red blog is to do a control-A on the whole page
 
@DocKimbel Amen. My website, currently down, is in WordPress and I keep making overtures toward doing something about the problem and then not doing it.
And the code highlighting plugin I installed however many years back is really bad, and one of the many things I have done nothing about.
 
posted on August 11, 2013 by noreply

This new release took a while, first because a lot of work was done since the last release, about 390 new commits were added and 44 issues were fixed over 80 new tickets opened since the last release. But it was also delayed because, a month ago, I was invited at Recode 2013 developer conference to give a talk and present the latest advancements on Red. I would like to thank again p

 
@GrahamChiu Damn, someone figured out how to reveal the text...I need to find a better way to obfuscate it in the future. ;)
 
12:33 AM
@DocKimbel Try using French. That works for me.
 
@GrahamChiu Too easy with Google Translate, maybe Klingon or Vulcan. ;-)
 
@DocKimbel Google translate doesn't necessarily translate concepts. For instance server I think is usually translated as waiter
 
@GrahamChiu More seriously, I tried to tweak the CSS several times to make the text more readable, but I couldn't achieve anything better than that so far. If someone has propositions for improving it, I'd glad to give someone access to it.
@rgchris --^
 
 
3 hours later…
3:46 AM
I am coming across something in Saphirion/View that I think is not consistent.  I've tried reducing to the following code. Could someone take a look at it and see if the black bar on the right looks as it should:

img: make image! reduce [450x450 white]
repeat num-x 10 [
	repeat num-y 100 [
		poke img to-pair reduce [(439 + num-x - 1) (339 + num-y)] black
	]
]
repeat num-x 10 [
	repeat num-y 100 [
		poke img to-pair reduce [(num-x - 1) (339 + num-y)] black
	]
]
view layout [image img]
"Looks right" meaning that it is the same width as the other
 
4:05 AM
the default layout padding could be evened out as well. Is this something I should submit to curecode?
Screenshot of above code : imgur.com/tRR8yCF
 
 
4 hours later…
8:02 AM
@RebolBot do header: [ [ needs: [bot-api 1.0.0] ] ]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> header: [[needs: [bot-api 1.0.0]]]
== [[needs: [bot-api 1.0.0]]]
 
@RebolBot do header: [ [ needs: [bot-api 1.0.0] ] ] type? first header
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> header: [[needs: [bot-api 1.0.0]]] first header
== [needs: [bot-api 1.0.0]]
; Brought to you by: tryrebol.esperconsultancy.nl
>> header: [[needs: [bot-api 1.0.0]]] type? first header
== block!
 
@Rebolbot do message: make object! [needs: []]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> message: make object! [needs: []]
== RESULT is an object of value:
   needs           block!    length: 0
 
 
3 hours later…
10:38 AM
@astderek Thank you for the updates to the read me and the other pull requests for the bot :-)
 
 
2 hours later…
12:10 PM
Red repo moved to https://github.com/red/red Yay!
 
12:41 PM
@HostileFork OK. Fixed the tweet issue. The tweet was just over 140 chars hence it failed, but twitter reformats the urls to bit.ly links which brings the char count back down again. rgchris kindly provided an override refinement to handle this (in other words allow 200 chars through in the hope that the bit.ly links will fix it)
 
12:55 PM
@onetom Time to work on the batch scripts for processing: github.com/dockimbel/cheyenne ;-)
 
@DocKimbel awesome! :) so what's the 1st step?
 
@onetom There's no hurry actually, we can take a few days to do that. First thing is giving you access to my server, did I create you an account there?
 
@DocKimbel dont thing so. which server?
make a onetom account
 
@onetom cheyenne-server.org
 
nope
my pub key is on this page still: pad.hackerspace.sg/p/rebol
 
1:07 PM
@G.RobertShiplett Thanks for the pointer to Icon. I see what you mean about the string processing, very simple.
 
@onetom ok, try to log in now.
 
ks397377; im in
 
@onetom Good. :) Any private channel we can continue this discussion on?
 
1:22 PM
skype for example. or teamspeak in voice over talk.rebol.info
 
@onetom I don't seem to have you on skype, just send dockimbel a request there.
 
i've added you but no response so far
 
@DocKimbel Congratulations on the new red release!
 
1:48 PM
@rebolbot do ; match one character as long as it's not a single-quote
@rebolbot do parse/all {a} [not #"^'"]
;; hmm, this errors out in my r3 repl, "script error: Invalid argument: ?native?"
 
; Brought to you by: tryrebol.esperconsultancy.nl
>>
== none
; Brought to you by: tryrebol.esperconsultancy.nl
>>
== none
; Brought to you by: tryrebol.esperconsultancy.nl
>>
== none
 
@RebolBot do
parse/all {a} [not #"^'"]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> parse/all "a" [not #"'"]
== false
 
@johnk Thank you John!
 
@paultarvydas Note that the /ALL refinement of PARSE has no effect for block rules (in R3).
 
1:53 PM
@earl I'm not sure that I understand that nuance. I'm using /ALL to ensure that spaces are not ignored in the string (first arg) (I think)
 
@paultarvydas /ALL has no effect in R3 PARSE, except when you use PARSE for string splitting. (And the string splitting functionality should be removed from PARSE anyway, eventually.)
@paultarvydas In other words: when your second argument to PARSE is a block!, spaces are never ignored (and /ALL has no effect).
 
@earl I'm rtfm'ing rebol.com/r3/docs/concepts/parsing-summary.html - is there a better doc? [ah, ok, now I understand your earlier response]
... and, in fact, I'm running repl in rebol.el - if I run it in a separate bash, it doesn't error out
 
@paultarvydas Then you're probably running Rebol 2 without knowing it.
 
@earl oh, duh - you're right - it says 2.7... at the very top. You saved me some grief, thanks
 
@paultarvydas You could try @Inaimathi's recent attempts at better integrating R3 with Emacs: github.com/Inaimathi/r3-mode
 
2:00 PM
@earl I thought I was using his :-)
 
That's only 9 days old, though, and I have no idea about it's current state (other than what is described in the related blog post). And I have not used it :)
 
@earl @Inaimathi ok, I'll contact him for a refresh
 
2:39 PM
oi vey! I am having some mental block this morning ! I posted the question as to why I am losing my encoding if I read into var my web source and then write/append to localfile but a one-liner write/append %fn read utf-8-stuff works fine (the output file reads as utf-8 input to the next script)
write/append %localfile read my-site.net/myutf-8-file ; thiis writes utf-8 out
 
0
Q: reading UTF-8 encoded file with rebol3

G. Robert ShiplettUsing Spahirion R3 I read my own utf-8 web files but then the files that I write/append to does not appear to be utf-8. Have I misunderstood the docs and help for read, i.e., /string - Convert UTF and line terminators to standard text string I am doing simple r1: read http: ... write/append...

 
sorry - this chat is flipping what I prefix with H -T-T-P as a url link ... my bad
I hope my edits to the question make it clearer ... I start my day in French, German and Japanese ... I thought it was only my typing in English that was deteriorating ;-)
 
@G.RobertShiplett Check into Markdown, it is used by GitHub, Trello, and Stackoverflow's Q&A and chat... somewhat popular these days.
 
@G.RobertShiplett put the code into back ticks, like http://blah.com so the http bit is preserved
 
OK That will go a long way to solving this problem ;-)
Have I forgotten something basic about rebol3 here ?
 
2:53 PM
@G.RobertShiplett It's surprising that an intermediate variable would cause any problems. READ without refinements returns binary data and WRITE of binary data should just add that... it shouldn't matter if you put it in an intermediate variable or not...
@G.RobertShiplett Perhaps you could refine your example so instead of http://... it was a URL of a small few-byte-long piece of problematic data, and then a printout of the expected vs. actual output.
 
it is the write/append that is my problem
If I just read ONE file into a var and then just write that var to a file, all its well.
It is the next read and the subsequent write with append as refinement that produces non-utf-8 output
 
@G.RobertShiplett Ah. Well, this is why the details are important! The classic link: Short Self Contained Correct Example
 
3:08 PM
@G.RobertShiplett If you read & write/append the same URL two times, is that a problem as well?
 
these are just Japanese text web pages in utf-8
I just tested by taking one at random which reads fine on the web and then another at random to read into a second var - all is well if I do not use write with the append refinement ... so I have to position at eof as if this were binary data and not ordinary non-English web text files ?
Oh, I can try that ... random test would include same file twice ;-)
one moment please ...
ah-ha ! not every file served by my own web app server is coming back utf-8 !
I am using nkf on a CentOS server ... but some files must not be converting as intended
Could I have tested the var for type? binary! to escape this mess ? Yes.
 
Please delete your question then, as it's not really answerable as is.
 
wilco
done
so a 'random' test is not "pick any file name from ls -l tty output;-)
 
3:26 PM
@G.RobertShiplett I'll re-recommend the Short Self Contained Correct Example essay. :-)
@earl So... about that PARSE/ALL...
I'd file that under "things that shouldn't be hard to have done by now"
It's not controversial. So I think asking why something that's not controversial can't be done yet, and removing whatever the barriers are to having that thing done, would be a good idea.
 
@HostileFork I think the main issue, is that no one has done it yet.
I don't even know if the suggested change to PARSE is controversial, but I know that what I have in mind as a replacement (SPLIT) has been slightly controversial in the past.
 
@earl Making it easer and more seamless to specify formally how you handle letter, digit, whitespace, symbol is a much better direction than doing some oddity under the hood where you kind-of-ignore things, but then you don't really because they are visible to primitives like COPY...
 
@HostileFork I'm not even sure we are talking about the same thing right now.
 
3:42 PM
@earl Well to get on the same page: PARSE has a refinement called /ALL and in Rebol2 it had a sort of filtration over the input regarding certain whitespace unless you said /ALL. Then in Rebol3 /ALL hung around but had no effect. So far we are talking about the same thing?
@RebolBot
help parse
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> help parse
USAGE:
    PARSE input rules /all /case

DESCRIPTION:
    Parses a string or block series according to grammar rules.
    PARSE is a native value.

ARGUMENTS:
    input -- Input series to parse (series!)
    rules -- Rules to parse by (none = ",;") (block! string! char! none!)

REFINEMENTS:
    /all -- For simple rules (not blocks) parse all chars including whitespace
    /case -- Uses case-sensitive comparison
 
Okay, has an effect on "simple rules" but not blocks. But we don't tend to use or encourage these simple rules.
 
@HostileFork Today, parse has two distinct functions: (1) series splitting, (2) rule-based parsing. In Rebol 3, /ALL only has an effect when in series splitting mode (1), but not in rule-based mode (2).
Arguably, series splitting is a functionality that should be better moved elsewhere.
 
Okay well I forgot about simple rules and just thought that /ALL was dead, but now that I recall there is another way of using parse, yes, I remember not liking that either.
 
I think up to this understanding, the argument is relatively uncontroversial.
Of course, that's also only half a solution. Still leaves open the question where to move the series splitting functionality and how to properly implement it.
 
3:50 PM
...or whether the best way to do series splitting is by making it painless to use parse to do it by giving people some nicer general purpose ways to express it.
It just seems like so many problems of input and data processing have edge cases and if you put a "split" in the box you're encouraging people to generate large intermediates that sort-of-work which they then tinker with afterward, rather than just writing a few more characters of PARSE actually applying to the input data you have. I could be wrong, but that's how it seems.
The reason, I theorize, that SPLIT or related shortcuts seem so attractive is because of the absence of whitespace and letter/uppercase and other useful character set generators, which if they existed would make parse rules easier to write, and that knowledge would be more generally applicable rather than learning the nuances and refinements of something more limited.
 
@HostileFork That's certainly true, but coming from a strong systems/performance programming perspective. If that were the main driving force for the language design, we'd have to do many things very differently.
@HostileFork I slightly doubt that. For the typical splitting tasks, you hardly need predefined character sets.
 
I don't think it would hurt to have a SPLIT, and one can even think about generalities of split like split [apple banana pear apple orange] 'apple => [banana pear orange], and one could discuss it until the cows came home, but it seems that getting the behavior out of parse sooner rather than later and dropping /ALL would -- if anything -- motivate those discussions and not be a decision that needed reversing.
 
There's a rather nice and flexible SPLIT implementation written by @GreggIrwin in CureCode issue 1886. (@BrianH had some concerns about it, but I forgot what they were. Probably it's just the use of /INTO.)
At it core, series splitting boils down to:
 
Perhaps the greater point is that I'm advocating "doing any decisions that don't need to be gone back upon"...even if there is no new solution to certain territories yet, as long as you know what shouldn't be done and stop that bit.
 
collect [
  parse series [
    any [mk1: some [mk2: delim break | skip] (keep/only copy/part mk1 mk2)
  ]
]
(Splitting SERIES by DELIM.)
 
4:03 PM
I'm unworried by the lack of a new answer to the splitting functionality of parse, and would prefer the didactic benefits of a PARSE with no /ALL and that could be more simply defined... and it would motivate people to go examine their split usage and help get that worked out while parse got visibly cleaner.
 
@HostileFork Yep. But I'm sure you also know the painful cries of users if you take oft-used functionality away and promise to provide a functional replacement "later".
 
@earl Well you just provided a workaround. Is there any user who couldn't live with that for the moment?
 
@HostileFork I'd prefer either merging Gregg's SPLIT right away, or at least providing the basic workaround as SPLIT right away. Less painful support."Want string-splitting PARSE? Use SPLIT!"
 
Well, all right. You've got a deal. So it's decided. PARSE will lose /ALL, "simple parse" will go away and always take a block of rules, and Gregg's split will ship in the box.
I think that a migration to SPLIT, given the knowledge that this is the right direction for PARSE, will motivate refinements to its design...and it will also cull the uses of that when well-formed parse rules specific to the problem at hand are the better idea.
 
4:23 PM
posted on August 11, 2013 by abolka

[Wish] Series splitting and rule-based parsing are two mostly unrelated functionalities. They should not be conflated into a single function. This would make PARSE's /ALL refinement obsolete, the presence of which regularly leads to misunderstandings regarding /ALL's effect on rule-based parsing, especially for those with a background in Rebol 2. This would also make PARSE's implementation sim

 
4:33 PM
@earl Works for me, but I do want us to move forward on the basics... getting Rebol's GitHub to rebol/rebol, trusting a set of people to be in charge of it as Carl doesn't have time, finishing the web forwarding and getting the new websites up...
 
 
1 hour later…
5:49 PM
@RebolBot
do [
; comment
print {done}
]
 
@AstDerek What?
 
@RebolBot
[
; comment
print {done}
]
 
@AstDerek Can you elaborate on that?
 
@RebolBot
do [print {done}]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> do [print "done"]
done
@HostileFork I'm a-liiiiive!!!
 
5:54 PM
Then why didn't you execute that previous expression?
@RebolBot
do [
print {done}
]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> do [print "done"]
done
 
@RebolBot
do [
; foo
print {done}
]
 
@HostileFork What are you trying to say?
 
@AstDerek Well, there's a bug...
 
@HostileFork due replacing new lines with spaces
 
5:57 PM
@RebolBot
comment {Incidentally, @AstDerek, there is a comment function, which takes strings or blocks or whatever...but unlike the semicolon comments, the structure is "there" in the program.}
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> comment {Incidentally, @AstDerek, there is a comment function, which takes strings or blocks or whatever...but unlike the semicolon comments, the structure is "there" in the program.}
 
Doesn't do anything
 
like nop
 
Yup, but it can take blocks of code as a parameter.
@RebolBot
comment [print "You can't see me!"]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> comment [print "You can't see me!"]
 
6:00 PM
@AstDerek another interesting distinction in Rebol is between a return value of type NONE! and a return value of type UNSET!
Print and comment return a value of type unset, so you don't see any result in the evaluator. It's relatively uncommon to invoke or construct an unset value, but it behaves a little differently.
 
@rebolbot do type? print []
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> type? print []

== unset!
 
@RebolBot
you-can-do-this-too: func [] [return #[unset!]]
you-can-do-this-too
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> you-can-do-this-too: func [] [return unset!] you-can-do-this-too
== unset!
 
Bot bug. Try that in the console.
Generally Rebol functions return none in these cases because it facilitates chaining better
 
6:08 PM
I found this situation while trying to read the header, to validate a command file:

`header: load/header rejoin[command-dir command]`
`header-desc: first header`
`'bot-api = first header-desc/needs`

Is there a way to be more concise with these evaluations
@HostileFork return #[unset] did the same in the console
 
@AstDerek You do need the exclamation point in there. But for me it just doesn't show anything (like print) Hmmm.
 
@HostileFork typo, it is in there at the console: >> fu: func[][return #[unset!]]
 
@RebolBot
stuff: [a [b c] d]
probe second stuff
probe second second stuff
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> stuff: [a [b c] d] probe second stuff probe second second stuff
[b c]
c
== c
 
assume [b c] to be an object
 
6:13 PM
@RebolBot
stuff: [a [b c] d]
probe stuff/2
probe stuff/2/2
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> stuff: [a [b c] d] probe stuff/2 probe stuff/2/2
[b c]
c
== c
 
:O
 
@AstDerek Blocks and objects are distinct types in Rebol.
And to be honest, Rebol objects are a bit hard to get one's mind around... because they're very related to contexts... and contexts are kind of how a lot of the interesting weirdness happens.
@AstDerek And again, to sort of piece together the puzzle of what is going on here, "slash" isn't a field selection operator or array indexer or anything. stuff/2/2 is a PATH! with three elements, with strong overlap in behavior to a block e.g. [stuff 2 2] They're morally equivalent.
Just "flavored" differently. And the DO "dialect" (if we are to call it that, which has been argued to be a bad idea) makes the choice on how to handle that particular tinkertoy for field selection, array indexing, etc. It's pretty far out.
 
so, it might be that the parser behaves different from what I think it'll do?
 
@AstDerek If you know what the parser will do after just meeting the language, I'd be impressed. :-) But the point is just that if you look at Rebol, what happened is that there are these parts that are dressed up to look like other languages but under the hood it just isn't. a: 10 looks like colon is the assignment operator and that's not what's happening at all. Yet a: b: c: 10 works with no special handling for that construct...
@RebolBot
length? quote stuff/2/2
 
6:26 PM
; Brought to you by: tryrebol.esperconsultancy.nl
>> length? quote stuff/2/2
== 3
 
@RebolBot
third quote stuff/2/2
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> third quote stuff/2/2
== 2
 
that sounds a git esoteric
*a bit
@Rebolbot do set-word!
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> set-word!
== set-word!
 
@RebolBot
set-word!: :print
set-word! "Understanding what's happening here is part and parcel of 'getting' Rebol, and the difference between the signfier and the signified... values vs. words, etc."
 
6:37 PM
; Brought to you by: tryrebol.esperconsultancy.nl
>> set-word!: :print set-word! {Understanding what's happening here is part and parcel of 'getting' Rebol, and the difference between the signfier and the signified... values vs. words, etc.}
Understanding what's happening here is part and parcel of 'getting' Rebol, and the difference between the signfier and the signified... values vs. words, etc.
 
@RebolBot
type? quote set-word!
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> type? quote set-word!
== word!
 
@RebolBot
type? first [a: 10]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> type? first [a: 10]
== set-word!
 
it means you cannot touch natives, you can just reference them?
 
6:39 PM
@RebolBot
(quote set-word!) = (type? first [a: 10])
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> (quote set-word!) = (type? first [a: 10])
== false
 
@RebolBot
(get set-word!) = (type? first [a: 10])
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> (get set-word!) = (type? first [a: 10])
== true
 
@AstDerek Well... a "native!" means a very specific thing in Rebol, but yes... they behave kind of like "a value of type function". A "datatype!" is another built in thing that you cannot change; there's a fixed number of them.
But the words that refer to these things can be changed, although you can also protect them.
@RebolBot
protect 'set-word!
set-word!: :print
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-locked-word.html
>> protect 'set-word! set-word!: :print
*** ERROR
** Script error: protected variable - cannot modify: set-word!:
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
7:02 PM
It looks like there is also a censorbot active in this room.
 
@RebolBot
print {What good is having history if you can't revise it, @iArnold?}
@RebolBot delete
 
@HostileFork so, to create a context, you'll need an object?
 
@AstDerek There is an explicit context creation... http://blog.revolucent.net/2009/07/deep-rebol-bindology.html
 
7:47 PM
@RebolBot
type? context [a: 10]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> type? context [a: 10]
== object!
 
8:12 PM
@HostileFork That is actually an error. CONTEXT is a function calling MAKE OBJECT! in fact.
 
8:26 PM
posted on August 11, 2013 by kealist

[Bug] Changing pixels along the right edge reveals that the right side edge is being cut off. Both black bars should have the same width. See http://imgur.com/tRR8yCF for file showing the problem The layout padding is also uneven on the right and bottom edges.

 
@RebolBot do fu: func [][ context [ hey: 457 ] ] fu
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> fu: func [] [context [hey: 457]] fu
== RESULT is an object of value:
   hey             integer!  457
 
@RebolBot
fu: does [c: context [x: 13] d: context [x: 12] print c/x + d/x] fu
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> fu: does [c: context [x: 13] d: context [x: 12] print c/x + d/x]
== make function! [[][c: context [x: 13] d: context [x: 12] print c/x + d/x]]
; Brought to you by: tryrebol.esperconsultancy.nl
>> fu: does [c: context [x: 13] d: context [x: 12] print c/x + d/x] fu
25
 
can something like this be done purely with parse, or do I need to wrap parse inside a function?: match "(a+b)" then return a new block [a + b]
 
8:45 PM
@HostileFork rebolbot removes all new lines from the input so don't use comments inline
 
@rebolbot do
letter: charset [#"a" - #"z"]

example: func [str /local lhs rhs] [
parse str [#"(" copy lhs letter #"+" copy rhs letter #")"]
reduce [ to-word lhs '+ to-word rhs ]
]

in: "(y+z)"

example in
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> letter: charset [#"a" - #"z"] example: func [str /local lhs rhs] [parse str [#"(" copy lhs letter #"+" copy rhs letter #")"] reduce [to-word lhs '+ to-word rhs]] in: "(y+z)" example in
== [y + z]
 
@RebolBot
letter: charset [#"a" - #"z"]

assert [
    parse "(y+z)" [
        (result: [])
        #"("
        copy temp letter (append result to word! temp)
        #"+" (append result quote +)
        copy temp letter (append result to word! temp)
        #")"
        (probe result)
    ]
]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> letter: charset [#"a" - #"z"] assert [parse "(y+z)" [(result: []) #"(" copy temp letter (append result to word! temp) #"+" (append result quote +) copy temp letter (append result to word! temp) #")" (probe result)]]
[y + z]
== true
 
9:03 PM
@paultarvydas Given that parens can be used inside of parse to run code as long as the match is made, then you can do pretty much "anything" inside of parse without a separate function. Parse can also "return" something besides true or false if you tell it to.
@RebolBot
parse "abc<hello>def" [to "<" return thru ">"]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> parse "abc<hello>def" [to "<" return thru ">"]
== "<hello>"
 
@RebolBot
probe to block! load replace/all "(y+z)" {+} { + }
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> probe to block! load replace/all "(y+z)" "+" " + "
[y + z]
== [y + z]
 
@GrahamChiu Does RebolBot really need to repeat the code? Can't it just mark the evaluation as a reply to the instigating message? There could be some kind of echo refinement or perhaps a command where you could ask for it if you wondered if what it "heard" was different than what you "said"
 
@HostileFork Design decision
 
9:20 PM
@HostileFork I'm thinking recursive-descent parsing with multiple rules. Each rule would return a block to the calling rule which would integrate the returned block into a larger block and return that to its caller. The "append" version above looks close to what I'm thinking, but I see that you needed to call probe to show the result while parse insisted on returning true or false. I guess that I was expecting parse's "return" to return anything I wanted instead of just the matched input
(as per http://www.rebol.com/r3/docs/concepts/parsing-summary.html)
@rebolbot delete
 
@paultarvydas PARSE's RETURN can basically return anything you want, as long as you just return the value of an action (a parent).
@RebolBot
parse "foo" [return (42)]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> parse "foo" [return (42)]
== 42
 
@AstDerek @HostileFork Use EXIT to return unset! from a function (i.e. exit instead of return #[unset!]).
 
@rebolbot
example2: parse in [(result: [] temp: [])
#"("
copy temp letter (append result to word! temp)
#"+" (append result '+)
copy temp letter (append result to word! temp)
#")"
return (result)
]
example2
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-no-value.html
>> example2: parse in [(result: [] temp: []) #"(" copy temp letter (append result to word! temp) #"+" (append result '+) copy temp letter (append result to word! temp) #")" return (result)] example2
*** ERROR
** Script error: example2 has no value
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
9:31 PM
bug? the above worked in my repl
what is the trick to getting nicely indented code in this chat?
 
Unless you address RebolBot you can send multi-line messages with a "fixed font" markup. Either press Ctrl-K or the "fixed font" button appearing to the right of the message box once you use Shift-Enter for a second line.
@paultarvydas Most likely IN and LETTER where predefined in your session, but are not for RebolBot.
@paultarvydas The problem with RETURN for recursive descent rules, is that RETURN always completely breaks out of PARSE and not just the current rule block.
 
@earl so , it seems that the only way to do recursive descent is to use functions (with parse's inside)?
 
@paultarvydas For matching per se, PARSE is fine. If you want productions (actions) as well, you can still collect the results out-of-band and not as the PARSE result.
Gotta run now, later!
 
@rebolbot

in: "(a+b)"

letter: charset [#"a" - #"b"]

tree: []

example2: parse in [
(result: [])
#"("
copy temp letter (append result to word! temp)
#"+" (append result '+)
copy temp letter (append result to word! temp)
#")"
(tree: result)
]

example2
tree
@rebolbot delete
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-no-value.html
>> in: "(a+b)" letter: charset [#"a" - #"b"] tree: [] example2: parse in [#"(" copy temp letter (append result to word! temp) #"+" (append result '+) copy temp letter (append result to word! temp) #")" (tree: result)] example2 tree
*** ERROR
** Script error: result has no value
** Where: parse
** Near: parse in [#"(" copy temp letter (append result to word! temp...
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-no-value.html
>> in: "(a+b)" letter: charset [#"a" - #"b"] tree: [] example2: parse in [#"(" copy temp letter (append result to word! temp) #"+" (append result '+) copy temp letter (append result to word! temp) #")" (tree: result)] example2 tree rebolbot delete
*** ERROR
** Script error: result has no value
** Where: parse
** Near: parse in [#"(" copy temp letter (append result to word! temp...
 
9:44 PM
@rebolbot delete
@rebolbot do letter: charset [#"a" - #"z"] in: "(y+z)" tree: [] example2: parse in [ (result: []) #"(" copy temp letter (append result to word! temp) #"+" (append result '+) copy temp letter (append result to word! temp) #")" (tree: result) ] example2 tree
 
@paultarvydas What are you trying to say?
; Brought to you by: tryrebol.esperconsultancy.nl
>> letter: charset [#"a" - #"z"] in: "(y+z)" tree: [] example2: parse in [(result: []) #"(" copy temp letter (append result to word! temp) #"+" (append result '+) copy temp letter (append result to word! temp) #")" (tree: result)] example2 tree
== [y + z]
 
10:01 PM
@paultarvydas Another way of doing the append result is to use collect and keep
@rebolbot
collect [ parse "a" [ "a" (keep 'a) ] ]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> collect [parse "a" ["a" (keep 'a)]]
== [a]
 
@rebolbot do collect [parse "a" ["a" (keep [x + z])]]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> collect [parse "a" ["a" (keep [x + z])]]
== [x + z]
 
10:32 PM
@johnk ah, but collect-keep is not recursive (dynamically scoped), so a set of recursive descent rules doesn't work - but it does hint at a solution...
 
@paultarvydas That's very interesting.
 
11:03 PM
@paultarvydas I am not sure if this helps, but there is a /only refinement to keep which might be of use
@RebolBot do collect [parse "a" ["a" (keep/only [x + z])]]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> collect [parse "a" ["a" (keep/only [x + z])]]
== [[x + z]]
; Brought to you by: tryrebol.esperconsultancy.nl
>> collect [parse "a" ["a" (keep/only [x + z])]]
== [[x + z]]
 
@RebolBot
img: make image! reduce [3x2 white] poke img -1x1 black print img
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> img: make image! reduce [3x2 white] poke img -1x1 black print img
make image! [3x2 #{
FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF
}]
; Brought to you by: tryrebol.esperconsultancy.nl
>> img: make image! reduce [3x2 white] poke img 3x0 black print img
make image! [3x2 #{
FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFF
}]
 
@RebolBot delete
@RebolBot
img: make image! reduce [3x2 white] poke img 2x0 black print img
@RebolBot delete
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> img: make image! reduce [3x2 white] poke img 2x0 black print img
make image! [3x2 #{
FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF
}]
 
11:18 PM
I understand that an image has a binary component that is series. Having negative pairs on images doesn't seem ideal to me
because in this case, the pair -1x2 seems that it should be off-image, not equivalent to 2x0
giving an error vs. having a strange side effect
 
11:48 PM
@RebolBot
img: make image! reduce [3x2 white] poke img 2x-1 black print img
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-bad-path-set.html
>> img: make image! reduce [3x2 white] poke img 2x-1 black print img
*** ERROR
** Script error: cannot set 2x-1 in path make image! [3x2 #{
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
}]
** Where: poke
** Near: poke img 2x-1 black print img
 
That result I would expect
@RebolBot
img: make image! reduce [3x2 white] poke img 4x0 black print img
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> img: make image! reduce [3x2 white] poke img 4x0 black print img
make image! [3x2 #{
FFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFF
}]
 

« first day (1015 days earlier)      last day (2765 days later) »