« first day (1072 days earlier)      last day (2708 days later) » 

12:59 AM
I think if your rep is over 2k, you can just edit tags and they don't need to be reviewed.
 
 
2 hours later…
3:20 AM
Is there going to be a Red/System tag as well as a Red tag?
 
 
3 hours later…
5:56 AM
posted on October 07, 2013 by Gregg

[Comment] I'm OK with it. As Ladislav said, it's a tradeoff.

posted on October 07, 2013 by Gregg

[Comment] Yes, I vote to remove it.

 
6:08 AM
posted on October 07, 2013 by Gregg

[Comment] I would like Red and REBOL to be in sync as much as possible. The AND argument is less convincing to me. It's always seemed counter-intuitive to me that refinements used are seen as TRUE. I understand the reason, but expect them to be their actual value or none more than expecting unused refinements to be FALSE.

 
@earl, I think that we should arrange a rebolsource meeting/conference
 
 
5 hours later…
11:09 AM
posted on October 07, 2013 by endo

[Comment] I agreed to remove it.

posted on October 07, 2013 by endo

[Comment] Sounds good.

 
11:33 AM
posted on October 07, 2013 by endo

[Comment] It looks OK to me. Actually I sometimes think about it, would be nice especially for EITHER in PRINT EITHER value "yes" "no" case. But I don't know if there are any BINDing issues for functions that return block! values. Or any performance issues.

 
11:57 AM
@earl, could you please review these changes on ELF.r for adding support for on-load/on-unload?
 
@DocKimbel Any thoughts on this refinements-as-true-or-false issue? Maybe it would be a better design to make a used refinement, e.g. /x, be initialized to /x ... and none otherwise? Using ANY and ALL can sort of finesse the logic issues.
 
@HostileFork Haven't followed the discussions about this topic, sorry...what is it about?
 
@DocKimbel Well, I found out that /local is just a convention, and everything after it in the function spec dialect is merely ignored by help. Sometimes refinements are done as a shorthand for specifying things that are to be used as locals themselves. e.g. func foo [/x] is shorter than func foo [/local x]
It starts seeming a bit weird if it thinks this way at a mechanical level to make unused refinements set to a value like false.
 
12:27 PM
@HostileFork I don't get your code examples, what is foo?
And what is your proposition?
 
@DocKimbel Oops, early, just got up. :-) foo: func I meant.
@DocKimbel Well, it's just that the TRUE/FALSE thing looks a bit arbitrary in the design, if refinements are really a way to declare a local. Even with TRUE/NONE the TRUE seems arbitrary.
So I was thinking that having a refinement be its own word-valued refinement if it is used and none if not would be at least something kind of interesting as an initialization.
 
12:46 PM
In other issues, doesn't calling the formatting hint for newlines at items in blocks new-line seem a bit weird, when newline is a character constant? Shouldn't it be some kind of more generalized formatting dialect function, e.g. format-block some-block [3 newline 4 not newline] to put a newline on the third element and no newline on the fourth? (Just making something up off the top of my head, but that would be the sort of thing I'm proposing)
 
1:34 PM
posted on October 07, 2013 by fork

[Comment] I brought it up in chat, and was in favor of removing it. I have seen twice discussions with new users where they ask roughly "where is ELSE?" Then they are pulled into a discussion which explains that EITHER is better, and if you wanted Rebol to have an "IF X THEN Y ELSE Z" style of programming, you could...but then IF would take 5 parameters and if you didn't use them all you'd ha

 
1:47 PM
Hello @jvargas.
I've written a routine before that turns [a b c d] x into [a x b x c x d] ... but what's the easiest way to do this?
@RebolBot
value: [a b c d]
while [not tail? value: next value] [
value: insert value 'x
]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> value: [a b c d] while [not tail? value: next value] [value: insert value 'x]
== [d]
 
Well, then you take the HEAD. Anything cleverer?
 
2:39 PM
posted on October 07, 2013 by hostilefork

This implements CC #2070, and deprecates PRIN to a mezzanine-level function. Ultimately it should be relocated to R3/Backward. As the ticket points out, a PRINT variant that omits spaces between block items--in addition to omitting the newline--helps mitigate cases where PRIN might be called several times in succession.

 
 
1 hour later…
3:46 PM
hello,
I have a sort of feeling that people are using github more and more nowadays, including for sort of web pages, wikis, a bit like if github was a CMS...
@HostileFork It seems like I would be the only one to regret if/else... I must confess that I like it. Not only because it is more "expressive" to me (personal taste), but also because you start to write an if block, and then you think about another option, and you just add the /else.
But I will just stay quiet on this one, as everyone agrees on it...
 
@pierre Well, that is an editing convenience, but I think that one should be considering more the longer-term issue of how the code reads/looks. The number of times a "node" of code is edited is over the long term probably less than that node is looked at.
 
... Although I'm sure that a newcomer to Rebol may appreciate if/else. It illustrates so well the refinements concepts, also.
 
Given Rebol's flexibility, we are not so much saying what you can and can't do on your own codebases. It's more about setting what is standard practice. There may be some IF/ELSE implementation in the wild, but it would not be something allowed in the module repositories on rebol.org
 
I may also regret PRIN: I use it quite often; but it is primarily for debugging purposes: the PRIN's usually gets deleted, eventually.
 
0
Q: is there an object constructor in rebol

pierreI usually program by functions in an "instinctive" manner, but my current problem can be easily solved by objects, so I go ahead with this method. Doing so, I am trying to find a way to give an object a constructor method, the equivalent of init() in python, for example. I looked in the http://...

 
4:09 PM
@pierre : @onetom brought up constructors recently
Sep 1 at 20:11, by onetom
Q: Is there a convention for object constructors?
 
@HostileFork ah!
Okay: work in progress, I guess, then... And I'm stuck with the (good old) Rebol 2: so I figure I'd better find another way than with an init equivalent...
@Ladislav Yes, I share a similar point of view: although I programmed a few C things in the past, diving into any C codebase written by someone else has always been quite painful.
 
4:25 PM
@pierre What do you consider a usage of PRIN that you would miss? Can you give a snippet?
 
4:38 PM
something like:
prin rejoin [x " "z " => "]
(something goes on and makes a result from x and z)
print result
 
@pierre Well is there a particular reason you wouldn't just do it all at once at the place you do the final print? print [x z {=>} result] ?
I'm getting to where I really don't like whitespace included in the beginning and end of string literals. So I'd even write print/only [x space z space {=>} space] Helps see where they are. There's SP as a shorthand for SPACE although I don't really like it.
 
well, the way I put it is where there is a change on the variables; so I find it just more convenient to do it tgis wat
(stupid android keyboard!)
 
@pierre There could be a /line and /spaced refinement too. If you say PRINT/LINE that could be like saying an implicit PRINT/ONLY/LINE, and if you say PRINT/SPACED it would be implicitly PRINT/ONLY/SPACED
print/spaced [x z {=>}] looks better than prin rejoin [x " " z " => "]
 
What I ofyen do, when I need to build a string, like an SQL statement, or any other code (rebol, oocalc formula, bash, etc.) is to take a "real" statement, and then replace whatever must be "parametrized" by variables, expressions, words:
that's why it is more handy to have strings like " => "
I'll be back soon to a REAL keyboard!...
 
5:29 PM
posted on October 07, 2013 by adrians

[Comment] I like it. The paren evaluation of both clauses seems odd at first, but doesn't detract from the overall idea.

 
5:41 PM
posted on October 07, 2013 by adrians

[Comment] Remove it or /else!

 
Programming in JavaScript makes me very sad.
 
@HostileFork I have a solution: do like I do: don't code in JavaScript!
 
@pierre I try not to, but sometimes it has to be done. :-/
 
@HostileFork I feel sorry for you, then.
Now I have a true keyboard!
So, what I was saying was:
I often must generate, say, an SQL statement a few zillion times, with some changing values:
I take a working statement, such as:
INSERT INTO public.lab_ana_batches_reception (
opid ,jobno,datasource ,labname,client,validated ,number_of_samples ,project,shipment_id,p_o_number,received ,info_suppl_json)
SELECT opid::numeric,jobno,datasource::numeric,labname,client,validated::date,number_of_samples::numeric,project,shipment_id,p_o_number,received::date,certificate_comments
FROM tmp_imports.tmp_tmp_2013_09_26_lab_ana_batches_reception_recorr_;
i check that it runs fine;
I paste it into my rebol code,
and I just replace whatever must change with variables, either with a REJOIN concatenating everything,
or with a bunch of PRIN which build an output, which will be piped into psql or something.
So, for this kind of work, PRINT/SPACED wouldn't work, although I think it is a good idea!
@HostileFork I personally like " " better than SPACE, as a shortcut. ;-) (personal taste...)
 
6:06 PM
@pierre Well, SP is technically shorter. The issue is that sometimes if you are using quotes you can't tell if you're at the starting quote or ending quote very easily by inspection... and leading or trailing spaces in the quotes make this even harder. Looking in the middle of something and seeing " foo " bar " " you wind up having to scan a lot to find out what's going on.
 
6:42 PM
@pierre This was my response:

Object Constructor

Sep 2 at 2:40, 2 hours 44 minutes total – 11 messages, 3 users, 1 star

Bookmarked 32 secs ago by rgchris

 
posted on October 07, 2013 by maxim

[Comment] As long as there are no measurable speed impacts on such high-use functions It's probably a good idea (it can even be back-ported to R2). Using this allows us to merge conditional ops and conditional statements into the same concept, based solely on what is provided to the conditional. Much cleaner than other languages which have two redundant syntax. IMHO the only real caveat, is

posted on October 07, 2013 by maxim

[Comment] remove, long standing deprecation which was supposed to be removed. No one uses it, it slows down eval and it's not even clean Rebol.

posted on October 07, 2013 by adrians

[Comment] I'd go with the proposed behaviour, but one thing should be kept in mind. Most people coming from other languages probably have the expectation that any type (even complex types) has a built-in stringified representation (usually a type name concatenated with a hash, if not overridden) and that it is usually called toString or something similar. Rebol docs should make it clear that 'f

posted on October 07, 2013 by maxim

[Comment] The culprit here is 'AND... it should simply behave and allow NONE! and switch to normal conditional evaluation, instead of math based bit fields. I have NEVER needed /refinements to be TRUE/FALSE in over 15 years... because all conditional code reacts equally to none/false. in fact, AND is used very rarely in Rebol.

0
A: is there an object constructor in rebol

DocKimbelThere is not special constructor function in Rebol, but there is a possibility to write ad hoc init code if you need it on object's creation in the spec block. For example: a: context [x: 123] b: make a [ y: x + 1 x: 0 ] So, if you define your own "constructor" function by convention ...

 
7:05 PM
@DocKimbel beat me to it :)
 
0
A: is there an object constructor in rebol

rgchrisTo my knowledge, there is no formal method/convention for using object constructors such as init(). There is of course the built-in method of constructing derivative objects: make prototype [name: "Foo" description: "Bar"] ; where type? prototype = object! My best suggestion would be to de...

 
@rgchris The more answers, the better. ;-)
 
In the spirit of magnanimity, I've bestowed your answer with a vote :)
 
posted on October 07, 2013 by maxim

[Comment] I agree that TO should be as simple as possible and when logical and possible, completely symmetric. TO STRING! TO BLOCK! "foo bar" should always return the original string.

posted on October 07, 2013 by maxim

[Comment] one thing which historically complicated matters was the issue of binding. I don't know how it's managed in R3, but in R2, to block! was one of few ways to get unbound words when converting strings into loaded rebol code: >> a: 5 print to-block "a" ** Script Error: a word has no context ** Near: a With the better binding controls we have in R3, this distinction is probably now ob

 
8:12 PM
posted on October 07, 2013 by Gregg

[Comment] I support this, and changing the name of the second param to 'value.

 
8:30 PM
posted on October 07, 2013 by Gregg

[Comment] I agree with the change for words: omit word decorations. On multi-value blocks, it does not go through FORM as I see it. FORM would include spaces, which is a more natural result to me. TO is like MAKE, or REJOIN without the REDUCE, which may be worth considering. It doesn't mean you can't work around it, but I'm not sure throwing an error is better.

 
8:48 PM
posted on October 07, 2013 by fork

[Comment] @Maxim - MAKE BLOCK! works as before for an unbound block, and is used by LOAD. So @DocKimbel prefers an error on TO STRING! of blocks. I argued that we have built a correspondence of there being a block which a TO conversion has said is unique among all blocks as the one that you get from an integer conversion. (e.g. TO BLOCK! 10 => [10], and not TO BLOCK! 10 == [5 + 5] or TO BLOC

 
 
1 hour later…
10:01 PM
@HostileFork I use prin as a way to show a simple progress bar in long running loops
I've been watching the progress while on holiday and it looks like there has been lots of good work, especially on those hard to catch tcp issues.
 
10:19 PM
@rgchris As yours is a good complement to mine, I've upvoted you too. ;-)
@HostileFork So @DocKimbel prefers an error on TO STRING! of blocks. I don't remember stating that?! I mentioned my preference for raising an error on TO scalar! series!.
 
@DocKimbel Oh, well I'll change it to TO INTEGER!. But to my mind TO STRING! on a block is the same; it's not a block, but you're putting a block in.
 
posted on October 07, 2013 by BrianH

[Comment] It was just in Rebol 2 to mollify the Rebol 1 users who missed the ELSE function. Good riddance.

 
@HostileFork I think that TO STRING! should work on any-type!, that's what every users expects.
2
 
@DocKimbel Per my argument before, I think there are too many options and too many variations in how the structure of a block could be converted to a string. TO is not supposed to require options. I liked my idea of to block! "foo: bar" => ["foo: bar"] with to string! ["foo: bar"] => "foo: bar".
The only sensible string to block conversions that emerges naturally from Rebol is to tokenize it or make a block with one string in it. We have the tokenization from MAKE and I think it would puzzle users of TO.
TO shouldn't be a flattener, a molder, or a FORMer.
TO should not cause loss of data; and a flattening of a block would most definitely lose data. You did not apply a "conversion".
 
10:34 PM
@HostileFork So now TO STRING! == FIRST too? IMHO, TO STRING! should simply serialize the argument somehow (serialization format to define more accurately maybe). Anything else would be counter-intuitive.
 
@DocKimbel Don't knock consistency, invariants, and logic in language design. Remember what we're trying to avoid. This concept that TO STRING!'s job is to do a parameterless serialization of an arbitrarily-deep block of arbitrary incoming data creates a monster.
There's more functions in the world than TO. And when you've put too much weirdness into TO, it ceases to be trustworthy/predictable.
 
@HostileFork How do you reconcile "TO integer! decimal!" with the "no loss of data" rule?
 
@earl Are there any others like that? I'd argue you should be more intentional and using rounding to say how you want it done. Although perhaps whatever the comparison tolerance is could be used to allow a sufficiently-close-to-integral decimal value to be converted... e.g. you could do to integer! to decimal! some-int-value
 
@HostileFork Others? Maybe.
 
@RebolBot
print 1.0 = 1
print 1.00000001 = 1
 
10:47 PM
; Brought to you by: tryrebol.esperconsultancy.nl
>> print 1.0 = 1 print 1.00000001 = 1
true
false
 
Whatever rule it's using there I would propose using; allow TO conversion only if it's equal to the integer.
 
Are you really trying to remove the most fundamental data conversion functionality?
 
posted on October 07, 2013 by abolka

[Comment] +1

 
I don't think that the "no loss of data" rule is applicable to conversions in general. Conversion can be lossy.
And while I like symmetry and reflexivity in general, I think that the to scalar! block-of-one!/to block! scalar! symmetry is a bit begging the question.
What we really want is a counterpart to FIRST (BLOCKIFY, or ENBLOCK, or whatever).
TO block! is a somewhat appropriate place for it, but probably not the best. It's already a tradeoff.
This already violates the general conversion rules. There is no immediately obvious conversion from an integer to a block. It's a cute hack, but very useful in practice.
To add another violation solely based on this first violation, where the second violation has no immediately obvious value in and of itself seems questionable to me.
 
@earl Well, that's what @DocKimbel said. So what's wrong with blockify?
 
10:54 PM
@HostileFork Nothing.
But I'm also fine with making to block! a synonym for basic blockify.
I'm just saying that while I really like your symmetry argument in and of itself, I think that there are other, stronger arguments here as well.
 
Well, this started with my concern that there were just too many behaviors in TO. A lot of functions stuffed under one word whose only description is "one type goes in, another type goes out". Without other invariants or symmetries then it's definition is only it's behavior matrix.
 
I'm very much in favour of reducing the irregularities in TO. Just don't lose sight of the obvious.
 
"It does what you'd expect it to, for that type in and the other type coming out. We mean the most commonly desired thing."* just isn't good enough of a characterization of a cross-product like that. And the TO STRING! of blocks and the TO BLOCK! of strings are good examples where I think plugging into this converter wasn't good.
 
TO STRING! of a block is a perfect example of what you can easily get right with the "obvious" rule.
 
I hardly find that obvious. FORM is non-obvious to me. The only thing that's sort of obvious would be MOLD, but then it would suggest putting back TO BLOCK! of a string to be like MAKE STRING!, which I don't think was a good idea.
 
11:02 PM
TO BLOCK! of a string is indeed something rather non-obvious, which we generally seem to be fine with letting go.
FORM, or MOLD, or MOLD/all are all good choices. Having TO STRING! result in a string representation (which is, more often than not, lossy in general) is the absolutely obvious.
 
I think what confuses me, is that if you have a value and you want to convert it to a string, and FORM and MOLD exist, why would you use TO STRING! to do it?
The only time you would want to do this would be in a case where you were doing TO UNKNOWN-TYPE ... and this is where I get on my soapbox.
 
Ideally, get rid of one of them.
 
Reason for the soapbox is that if you don't know the types then it's almost impossible to understand what your code is doing without some kind of invariants.
 
Also, you can choose different defaults for each operation.
(Just as with TO-INTEGER decimal! vs ROUND.)
 
Well, I have to take off... but I'll just say that if we're close to being able to come up with some invariants... like if target: to target-type source succeeds then source == to source-type target... then I'm perplexed as to why to resist that so strongly because you don't want to call MOLD or FORM to get strings flattened out of blocks.
It seems like an adamant desire to build that cross-product matrix, for its own sake, rather than have it understood via simple rules.
 
11:14 PM
I agree with the general sentiment, but I think that this particular invariant / symmetry is not useful.
I don't think it's worth crippling the immediately obvious single-step comparisons only to make multi-step comparisons regular.
 
So for instance on the TO INTEGER! 10.5 just making an arbitrary decision, that's cool? I personally think it would be cooler to have something that was smart enough to tell when perhaps the integer came from a "pure enough" conversion and only convert those, rather than having to guess what rounding rule it used.
I'll use round if I want to round.
 
That's why TO-INTEGER doesn't round.
Yes, some "arbitrary" decisions based on practicality are cool, IMO. Otherwise you're just shifting the problem elsewhere.
 
Yes, it rounds /down
 
It truncates, right.
 
>> to integer! 1.9999999999999999
== 2
 
11:18 PM
@earl Do you consider truncation practical?
 
@Ladislav Arbitrary.
 
>> to integer! 1.999999999999999
== 1
@earl Not always :-/
 
I guess that Carl actually argued against truncation.
 
@johnk Ask Ladislav about that :)
 
...at least that how his words can be interpreted
@johnk That is simple. You are making a mistake not understanding that there is some precision used.
 
11:22 PM
@RebolBot
same? 2.0 1.9999999999999999
@johnk 1.9999999999999999 is identical with 2.0 in 64-bit IEEE754 binary floating point.
So your "1.9999999999999999" is just not representable in that precision internally, so you're basically just asking "to integer! 2.0".
 
When you specify something like 1.9999999999999999, there is some rounding involved. It actually happens that the closest (that is the rounding) 64-bit IEEE 754 binary floating point number to 1.9999999999999999 is exactly 2.0
Obviously, 1.9999999999999999 is not an IEEE754 number at all, it can by only approximated by some IEEE 754 number
 
@earl That makes sense. Thanks
 
(Ladislav makes more precise sense :)
@DocKimbel Cool, I'll have a look.
 
On the to string! topic, why do we have to string! [ 1 2 ] => "12" and form [ 1 2 ] "1 2"?
I know the help says that form is "human readable". Is to string! not for humans?
 
@johnk We have got a choice which function to use when transforming a block to a string. Sometimes it is useful to insert whitespace, while sometimes it is useful to not insert whitespace between elements, depending on the job at hand. I find it useful to have a choice to be able to select the function that is best for the respective purpose
@johnk 'the help says that form is "human readable"' - I do not recommend to take that description too seriously. As far as I am concerned, I would say that the description is too short and too indefinite to be useful for uninitiated users
I remember we once were trying to describe somehow what STRICT-EQUAL? does. We found out it was quite impossible to describe it reasonably in a short string space, so we said: "Returns TRUE if the values are strictly equal." hoping that the user wanting to know more will turn to a more comprehensive documentation
 
11:42 PM
So we should use to string! to convert a block to a string without inserting whitespace and use form to convert a block to a string with whitespace seperators.
 
@johnk that seems quite arbitrary
wouldn't it make sense for 'to string! on non-scalar types to defer to form?
 
Why not for scalar types as well?
 
you mean defer?
 
Yes.
 
@Adrian Yes. Would we then need something like form/flat [ 1 2 ] => "12"?
 
11:56 PM
maybe because I could see form being customized to do complex-type specific "humanized" output whereas 'to string! for scalars would make sense to be pinned down to a specific conversion to a string representation
 
(/flat -- No indentation - similar to mold)
 
@johnk yup
 
Ultimately, what I have in mind is more like: make FORM defer to MOLD with a particular set of parameters (MOLD/flat/pretty, if you like), make TO-STRING defer to MOLD with the same or another set of parameters.
 
I just think that as it is, there is unnecessary redundancy (and therefore user confusion) between to string! and form for complex types
 

« first day (1072 days earlier)      last day (2708 days later) »