AltME: REBOL3

Messages

Maxim
might be me too...  but mine is highly customized... not very usefull anymore.
(for someone other than me)

DocKimbel
Is there a good reason for ROUND to return a decimal! instead of an integer! like it does in Rebol2?
Rebol3:
>> round 2.3
== 2.0
Rebol2
>> round 2.3
== 2
Endo
Help text says "ROUND returns the nearest integer" but it doesn't always return an integer: May be he thought that its better to keep the datatype of the return value same:
>> round/to 1.987 0.37
== 1.85
DocKimbel
There's no mention of the return type in the R3 version of ROUND docstrings.
Endo
It is on R2.
Gregg
Using /TO changes the result type, but with out it ROUND always returns an integer, correct? If so, the help string for /TO implicitly covers it I think.
But, for Doc, I don't know a good reason to change it. Do you have one?
Endo
Correct, returns integer for all other refinements.
Gregg
As you know, one of the reasons to return an integer was for use with loops.
Thanks Endo.
DocKimbel
@Gregg I don't understand the rationale of Rebol3 returning a decimal! instead of integer!. Qingtian implemented it in Red copying R3 semantics, but I am about to change it to have R2's semantics, but I want first, to understand the reason for R3's behavior.
Gregg
Ah, I see. I don't know why the change was made either, except that they made it a native from a mezz. Maybe it was just an implementation detail?
DocKimbel
It looks too obvious to be a bug, so I guess it was planned. I still don't get why as it makes it impractical for the common use-case.
Gregg
R3 changed to support non-integer values for loops, so the result is usable, but I don't remember why that change was made.
Pekr
IIRC, Ladislav implemented it for Carl, so if he is around, most probably he's the one who knows the answer?
Gregg
I think you're right Petr. He and I did the mezz version, so that makes sense.

Bo
How does one write data into a port in Rebol3? 'insert, 'append, etc. do not work.
Bo
I found this example, but it makes r3-view from Atronix crash:
client: open tcp://localhost:8080
client/awake: func [event /local port] [
    port: event/port
    switch event/type [
        lookup  [open port]
        connect [write port to-binary request]
        read [
           result: to-string port/data
           close port
           return true
        ]
        wrote [read event/port]
    ]
    false
]
wait [client 30] ;the number is a timeout in seconds
close client
(at least when using "client: open clipboard://" instead of a TCP port.

Last message posted 164 weeks ago.