« first day (1585 days earlier)      last day (2195 days later) » 

TGD
3:31 AM
@RebolBot
blk: [[10:45 1 5][11:23 2 4][12:01 3 3][9:01 4 2]]
sort/compare blk 2
 
; Brought to you by: try.rebol.nl
== [[12:01 3 3] [10:45 1 5] [9:01 4 2] [11:23 2 4]]
 
TGD
@RebolBot
do/2 sort/compare [[12:01 3 3] [10:45 1 5] [9:01 4 2] [11:23 2 4]] 2
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-bad-refine.html
    *** ERROR
** Script error: incompatible refinement: 2
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
TGD
@rebolbot help
 
I respond to these commands
Note: [] means optional input or shows expected datatype, (|) means choice:
(do|do/2|do/red|do/boron|do/echo) expression "evaluates Rebol/Rebol-like expression in a sandboxed interpreter. echo repeats exact command sent to r3"
(hi|hello|goodnight|goodbye|bye|[good][night|morning|afternoon|evening]) some-text "returns a greeting to the user who greeted bot"
cc id "retrieves curecode data"
delete [ loud ] "in reply to a bot message will delete if in time"
do/ideone which-lang [word! string! integer!] expression "evaluates a source expression for the specified langu
 
TGD
3:40 AM
>> sort/compare [[12:01 3 3] [10:45 1 5] [9:01 4 2] [11:23 2 4]] 2
 
; Brought to you by: try.rebol.nl
== [[10:45 1 5] [11:23 2 4] [12:01 3 3] [9:01 4 2]]
 
TGD
>> system/version
 
; Brought to you by: try.rebol.nl
== 2.101.0.4.2
 
TGD
@RebolBot
system/version
 
; Brought to you by: try.rebol.nl
== 2.101.0.4.2
 
TGD
3:43 AM
@RebolBot
sort/compare [[12:01 3 3] [10:45 1 5] [9:01 4 2] [11:23 2 4]] 2
 
; Brought to you by: try.rebol.nl
== [[10:45 1 5] [11:23 2 4] [12:01 3 3] [9:01 4 2]]
 
TGD
>> sort/compare [[12:01 3 3] [10:45 1 5] [9:01 4 2] [11:23 2 4]] 3
 
; Brought to you by: try.rebol.nl
== [[12:01 3 3] [9:01 4 2] [10:45 1 5] [11:23 2 4]]
 
TGD
>> sort/compare [[12:01 3 3] [10:45 1 5] [9:01 4 2] [11:23 2 4]] 1
 
; Brought to you by: try.rebol.nl
== [[9:01 4 2] [10:45 1 5] [11:23 2 4] [12:01 3 3]]
 
TGD
3:47 AM
It seems, that sort/compare is broken in rebol3. Does anybody know why?
 
 
2 hours later…
5:35 AM
There's a CC ticket about that, @TGD.
 
 
6 hours later…
11:57 AM
>> select [(a + b) c] quote (a + b)
 
; Brought to you by: try.rebol.nl
== none
 
>> help select
 
; Brought to you by: try.rebol.nl
USAGE:
    SELECT series value /part length /only /case /any /with wild /skip size /last /reverse

DESCRIPTION:
    Searches for a value; returns the value that follows, else none.
    SELECT is an action value.

ARGUMENTS:
    series (series! port! map! object! none!)
    value (any-type!)

REFINEMENTS:
    /part -- Limits the search to a given length or position
        length (number! series! pair!)
    /only -- Treats a series value as only a single value
 
>> select/only [(a + b) c] quote (a + b)
 
; Brought to you by: try.rebol.nl
== c
 
12:00 PM
@MarkI Path evaluation already is not a perfect map to "select". We've observed how with integers, it doesn't act like a SELECT. It sometimes acts as select, sometimes as PICK, sometimes as APPEND... it is not necessary to make all things work in path form because it simply has no one meaning. It's supposed to be there to make some common cases easier to type.
 
12:10 PM
>> print [quote some-word:]
 
; Brought to you by: try.rebol.nl
some-word:
 
In the past I was opposed to this idea, of "FORM"ing ("TO-STRING"ing in my new world) stray word types that make it to evaluation in PRINT. I would say that was an error, or probably represented a problem.
 
Public announcement :-)
86 tests passed, 459 tests failed.
CommonMark.reb is 15.78% ready.
 
@rebolek Sounds like progress :-)
 
@HostileFork Yes, fortunately, it's going fast. One fix, another 10-15 tests passed.
I can't spend much time on it but I try to do at least one improvement every day.
 
12:16 PM
@rebolek Well certainly thanks for working on it, and making me feel the switch was worth the time!
 
@HostileFork The decision to target CommonMark was a good idea. At least I have a test suite immediately available.
 
12:37 PM
posted on March 04, 2015 by fork

[Wish] Including the proposal of #2196 with caret-escape spaced, there are three main things you might want to do in a string conversion: * Get the "spelling" of the token without markup * Get the version with the markers on it * Get a LOADable version back Today this isn't divided very cleanly, except that the 3rd version is ostensibly done with MOLD (which is broken, e.g. `mold/all

 
12:48 PM
Hm, if FORM had always been TO-STRING, and MOLD had been FORM, that might wouldn't have been so ugly as to need changing.
Too late now, though. Because if MOLD is going to change it has to be something else. But just noticing.
 
 
2 hours later…
2:38 PM
@HostileFork Just confirming that's a yes answer to my question, right? To some it may appear that you don't want to actually say that.
 
@MarkI There've already been long discussions about how weird path evaluation is. I'm not sure if it should SELECT/ONLY or be an error. But I'm rather certain it shouldn't evaluate, or foo: quote (foo) then x/(foo) would infinite loop
I'm still on the fence about this: should foo: does [return 'bar] and then print ["Hello" foo] print out hello bar or should that be an error, that words don't coerce into strings for PRINT/COMBINE unless you explicitly ask them to?
So print ["Hello" to-string foo] would be what you'd have to do
 
2:54 PM
I hope everyone else is as impressed by this as I am:
>> "^(C5)" = "^(212B)"
 
; Brought to you by: try.rebol.nl
== true
 
That is some appreciated Unicoding, Carl!
And emphasizes how tricky Unicode comparison actually is even without considering case.
 
I bring up the PRINT thing because I noticed in changing HELP that if I forced you to do a TO-STRING on words then the code started getting messy. And then what to do if sometimes the routine returns a word or set-word, and other times a string?
It seemed the bigger "thing you probably need" was /SAFE like @rebolek suggested, to ask not to call any functions
So for now, I'm changing COMBINE/NewPrint to allow you to say print [quote foo:] and similar, and get foo: out of that.
 
3:11 PM
@HostileFork Oops, you are right, bad example, angstrom sign has case. Thanks HF!
Here is a better example, and is in no way related to s-cases.c:
>> #"^(03BC)" = #"^(B5)"
 
; Brought to you by: try.rebol.nl
== true
 
@MarkI Well, it's related to the line 0x00B5, 0x03BC, // MICRO SIGN so I dunno what you mean
 
@HostileFork Double oops. I'm giving up now. Hopefully, I'll be back when I'm less blind.
Looks like Carl indeed has merged the equivalence table(s) into the cases table. Not necessarily a bad idea ...
 
3:53 PM
@MarkI Not necessarily a bad idea for strict equality vs non-strict, but that suggests that the /CASE refinements should actually be /STRICT refinements
Given that CASE is a keyword of its own right, that might also be less confusing.
 
@HostileFork Agreed, good idea.
@HostileFork Rebol has keywords now? :)
 
@MarkI To the extent it has them, case is one.
Code like case [find/case [...] ...] isn't necessarily user-friendly
 
@HostileFork Also agreed, but that's the case function, not "keyword".
 
@MarkI You are perhaps confusing "keyword" and "reserved word" en.wikipedia.org/wiki/Reserved_word
But anyway, we don't really have a word for what I mean
Hence, "keyword"
Because what we're interested in here is specifically the word used in the box associated with the case function
And the reuse of that word in a refinement
"default-assigned word CASE", if you like
Something else struck me, just when we get to talking about word usages. PARSE has ANY and SOME. ANY accepts zero things.
>> if any [] [print "Zero things"]
 
4:14 PM
; Brought to you by: try.rebol.nl
== none
 
"Do you have any bananas?" => "Yes." => "Can I have one?" => "No, sorry, I have 0 bananas."
"Do you have any NUMBER of bananas?" => "Yes." => "Can I have one?" => "No, because that number is zero."
If one is comfortable with ANY in PARSE, it would seem for consistency that what is currently called ANY the function should be called SOME.
 
4:56 PM
@HostileFork In the do dialect, wouldn't the question be more like any [bananas? stuff-i-got] and in parse, the question is "Does the input list any numbers of bananas?" I don't think those "have" questions are very relevant to these cases
 
@kealist Just saying that if SOME is to convey "one or more things matching" (and zero is not suitable) then what we call ANY today as a function might be more consistently called SOME.
They are different things, and do different things, sure. But the word re-use suggests that if there's a way to be more consistent in how those words are applied it could be helpful.
 
5:11 PM
The main issue I would see with that is that any tends to be a word used interrogatively and thus it fits well with the *? words as well as if and either. some does not carry that type of usage, and to me would seem less readable for that reason. I'll think about it, but I don't think I will like it much.
if some [number? x equal? x y] [...]
 
Part-of-speech-wise it seems the same to me
 
They are both quantifiers, yes, but that's not what I meant.
 
There might be a true/false collapsing variant, like some?
 
"any" generally can only be used in questions or negative statements (with "not"/"never")
 
Well, the other possibility would be to think if ANY meaning zero is better read as OPT ANY and SOME is just confusing.
Then: Does {bbb} have any "a"s? No.
One fewer parse keyword and one less point of confusion.
parse "bbb" [opt any "a" any "b" opt any "c"] returning true (or returning "bbb", as I'd prefer) is more consistent with if any [] [print "this doesn't print"]
>> parse "bbb" [opt some "a" some "b" opt some "c"]
 
5:27 PM
; Brought to you by: try.rebol.nl
== true
 
Anyway, I just don't think the SOME/ANY distinction is very clear in the first place, and it's not really carried across.
 
6:00 PM
Any is a parse word meaning the same as opt some, but is shorter, cleaner, clearer, more concise, more elegant, more appropriate, and more meaningful.
 
@MarkI While I don't disagree with the convenience, I disagree with idea of meaning. I also think the argument on difference of the ANY function is a cognitive gap.
 
Oops, forgot more convenient :)
 
It's similar to how I do not think there's anything about the words "LOOP" and "REPEAT" that distinguish them.
Or FORALL vs FOREACH.
And FOREACH is just a terrible word.
 
@HostileFork New suggestion: LOOPEAT. Hahaha ...
@HostileFork Terrible, yes; better than anything else, also yes. Kinda like democracy :)
 
No, I think EACH is a fine word.
 
6:06 PM
@HostileFork "Each" does not mean "each in turn", neither connotatively nor denotatively.
 
And it seems fine to take FOR for the C-style for. for [x: 0] [x < 10] [++ x] [print x]
@MarkI The other option was for-each, and I believe that the tradeoff is such that it's better as EACH. There are many tradeoffs made in language, that's one where pulling out the EACH makes more sense than hyphenating things.
Anyway, this started on a coherence note about parse's ANY vs. the function ANY, where if in the Rebol universe ANY is to somehow connote "zero or more" there is a glaring inconsistency.
 
The only reason it was called FOREACH was to be familiar to existing programmers who were used to other languages. If it were more strictly Rebol-like it would have been FOR-EACH.
 
On an English language side note: "each" and "all" are synonyms, believe it or not. And there's a third synonym, "every" ...
 
The word "synonym" gets thrown around inappropriately. They all have different connotations.
 
So I said really, the ANY function is more of a parallel to Parse's SOME.
But that's mostly a tangent on what is pressing me at the moment, which is a decision on COMBINE/NewPrint's treatment of WORD! and ANY-BLOCK! types that are not BLOCK!
x: quote (1 + 2)
print [x]
The two answers I have for what that might do are: print (1 + 2), or raise an error
I favor error. Also you can currently get an infinite loop with:
x: [x]
print [x]
Which, doesn't kill any given idea, as you can also get an infinite loop with x: does [x]. Generally speaking, stopping infinite loops is not really on the agenda.
 
6:22 PM
BTW, Rebol has more keywords than just in parse; some other dialects have them too. SECURE (if it were working) has some; BIND block and MAKE OBJECT! block have 'self; MAKE MODULE! block has 'self, 'export and 'hidden; HELP has /local. It really depends on the dialect.
 
@BrianH Any vote on this print thing? Do you feel like print [quote foo:] should absolutely output foo: or do you think you should have to say print [to-string quote foo:] to avoid an error? Is there an "obviously you should convert everything to strings" idea?
Note that by the definition of COMBINE, NewPrint delves into blocks as PARSE does.
It doesn't just TO-STRING the block.
So print/with [1 [2 3] 4] ", " comes out as 1, 2, 3, 4
As would x: [2 3] with print/with [1 x 4] ", "
 
Converting to strings is one of the main features of PRINT, and that is consistent with other modern high-level languages. You don't have to write puts 2.to_s in Ruby, you can just write puts 2; the .to_s is implied. For PRINT, FORM is currently implied, or for PRINT block, REFORM is implied.
 
@RebolBot
x: quote (1 + 2)
print [x]
 
; Brought to you by: try.rebol.nl
1 + 2
 
@RebolBot
x: quote foo/bar
print [x]
 
6:36 PM
; Brought to you by: try.rebol.nl
foo/bar
 
@BrianH NewPrint's advantage in having nested COMBINE is very high. COMBINE is a REFORM replacement that doesn't have a silly name.
As for what parens should do, I don't know. Having them do iterative evaluations is one possibility. I guess I'd initially rejected that due to infinite loops, but that may not be a good reason.
I'm not a fan of "throw away the parentheses and sort of wing it".
Formality is another advantage here, where print x is the same as print [x], and combine [x y] is the same as combine [combine x combine y]
 
 
1 hour later…
7:43 PM
@HostileFork Just a thought I had. How about 'SPIT for 'PRIN ? Spit out a value without caring for a newline.
 
@iArnold SPIT and MOLD... we could keep looking for more gross words. :-) I like PRINT/ONLY and it is looking like you will be able to say print/only/with [{Spaces} {but} {no} {newline}] space and that covers that, while print/only [{No} {spaces} {no} {newline}]. If it's a simple PRIN of a string then PRINT/ONLY not combining with SPACE will not matter.
And with caret proposal: print/only/with [{Spaces} {but} {no} {newline}] ^_
Or print/only [{Spaces} ^_ {using} ^_ {caret form} ^_ {but no newline.}]
A lot of the cases where PRIN was needed before simply won't arise, because NewPrint has better answers most of the time.
 
 
4 hours later…
11:43 PM
posted on March 05, 2015 by abolka

[Comment] Right, sorry for the noise.

 

« first day (1585 days earlier)      last day (2195 days later) »