World: r3wp
[Core] Discuss core issues
older newer | first last |
Louis 7-Mar-2006 [3674] | Thanks Jaime. |
Ladislav 8-Mar-2006 [3675] | Should now be immutable? - this is quite unfortunate question - Now is a function returning a time! value in this special case (now/zone). Moreover, the returned value *is* immutable :-P. What are you questioning is not mutability, but the possibility to use this special time! value as an argument for the Add function. Can a timeone take the value 8:01 - again, an unfortunate question. Now/zone did return a specific time! value. If you add 60 seconds to such a value you obtain yet another time! value, but nobody is trying to convince you it is a timezone. |
Ingo 8-Mar-2006 [3676] | Hi Graham, yes that's it ... I actuallly add some things to the protocol, like mailbox handling, the ability to fetch only specific headers, etc. so I would like to be able to use a unified interface. Additionally I'd like to fetch by uid, and it would be nice if I were able to position to the read mail. |
PeterWood 9-Mar-2006 [3677x3] | Ladislav: I see your point about immutability. I guess that point about zone boils down to one of datatype. I had been thinking along the lines that zone was a special datatype but, after checking, I see if it is of type time!. What has confused me is the additional validation on time/zone in to-date: >> to-date 9-mar-2006/14:17:38+8:01 ** Syntax Error: Invalid date -- 9-mar-2006/14:17:38+8:01 ** Near: (line 1) to-date 9-mar-2006/14:17:38+8:01 |
and the rounding: >> a: 9-mar-2006 15:23 == 15:23 >> a/zone: +8:15 == 8:15 >> print a/zone 8:00 >> a/zone: +8:31 == 8:31 >> print a/zone 8:30 | |
which indicates that zone is a special case of time! | |
Ladislav 9-Mar-2006 [3680x4] | I had been thinking along the lines that zone was a special datatype - there is a possibility to propose such a datatype, but I am OK with time! in this case, because the new datatype wouldn't (just IMO) bring substantial benefits. So, we have to be careful when "composing" a new date! value. |
(which may be a good addition to REBOL documentation) | |
OTOH, your experiments suggest, that there are some "legal" timezones, that aren't representable in REBOL ? | |
(I should have said "legal" dates) | |
PeterWood 9-Mar-2006 [3684x3] | I did submit the two "missing" zones to RAMBO some time ago. Understandably, it was suggested that as the two time zones were so obscure it wasn't worthwhile catering for them. |
I would be good if the "zone" behavious was documented at least in the Datatypes! Appendix to the core user guide. I'll try to draft something and submit via Rabo. | |
Actually when I checked the documenation it already states : The resolution of the time zone is to the half hour. Perhaps the only clarification needed is that the timezone is always rounded down. | |
DideC 9-Mar-2006 [3687] | Is there a "Rebolish" way to change this string! : "A text with%27some%25encoded chars" to this string! : "A text with%some'encoded chars" Without using replace/all in a loop? |
Ashley 9-Mar-2006 [3688] | parse? |
DideC 9-Mar-2006 [3689x3] | In the other way there is 'to-url : >> to-url "a b" == a b But is there something simple to do the opposite ? |
GOT IT : dehex !!! | |
(I found it in 'decode-cgi) | |
Terry 13-Mar-2006 [3692] | Does Rebol have an equal to PHP's exit; function? |
Henrik 13-Mar-2006 [3693] | HALT is probably the closest |
Terry 13-Mar-2006 [3694] | Yeah, I suppose that would work from a cgi environment. |
Oldes 14-Mar-2006 [3695] | quit |
Terry 14-Mar-2006 [3696] | I need to keep rebol going... so some kind of 'throw'' |
Oldes 14-Mar-2006 [3697] | only wait if you want to wait and do not want to quit;-) |
Terry 14-Mar-2006 [3698] | too legit to quit |
Pekr 14-Mar-2006 [3699] | if I wait on multiple ports, and I am not using wait/all, what if there is event happening on two ports? Will it return one of them, or both in block? |
Pekr 15-Mar-2006 [3700x3] | if I have something like following: event: wait [server client1 client2 ... clientx 0.001] if block? event [event: first events] and now I just maintain one port and its data, I wonder what happens with next 'wait? Remember I am not using wait/all, but still I am not sure, what happens if there is even waiting on more than one port? |
... or simply without /all refinemet 'wait will always return only one of ports, even if data is waiting on multiple of them? | |
will not I loose data when 'wait is entered for the second time because of "if block? event [event: first event]"? Hopefully not ... or maibe wait without /all never returns a block, even if there is event on more than one port at a time? | |
sqlab 15-Mar-2006 [3703] | If I remember right, you get only the first event, the others will still appear as long as you did not satisfiy them. |
Pekr 15-Mar-2006 [3704] | ok ... so what happens if there is still data on first port in the wait-list? will it always return that one? So it means that other ports will simply wait for maintanance, because first port in the wait-list is still receiving a data? |
sqlab 15-Mar-2006 [3705] | I do not know if you will get your first port again as the first, if you did for example just copy/part from it. But imagine, that you do a copy on it, and new data arrives at the same time. This will probably raise a new event on it and this port will probaby the last in your queue of waiting events. |
Pekr 15-Mar-2006 [3706] | ah, thanks a lot ... so wait [port1 ... portn] does not anything in common with the order how 'wait returns the events? That is good, because otherwise I would maintain only first port, till the data would not stop appearing ... |
sqlab 15-Mar-2006 [3707x2] | Just what I think is a little bit annyoing, that sometimes you do not get the proper timeout, if you have a timeout value in your wait list and many events. Yes, I always thought that I got the ports ordered according their event time and not according their position in the event list. |
I have to correct me. I just tested this approach, and it does not look so good. It always gave me the data from one port | |
Pekr 15-Mar-2006 [3709x4] | ah, that is bad .... but expectable ... so I have to prioritise ports myself and probably always use wait/all ... but then - I am not sure I want to maintain them all at once .... |
but maybe that is the only corrent aproach - to use wait/all and maintain data on all ports in a loop, then go for the next wait ... | |
or, to use random to pick ports randomly :-) .... but it is interesting that 'wait returns events according to wait-list order .... | |
anyway - I am doing very small util for my friend who programs our new board for kiosk system event detection and am having fun with it :-) | |
sqlab 15-Mar-2006 [3713] | Just use small messages. I gather every day messages in the tenth of thousands with peaks during the working hours and it is working so far. |
Pekr 15-Mar-2006 [3714] | yes, it surely will work ... I was just curious what would by the correct aproach for multiplexing engine .... |
sqlab 15-Mar-2006 [3715x2] | My test now revealed, that you will maintain the port you get as first, until it is empty, but then there is always some prioritize. |
I just tested it with awake functions and this gave me data from two ports alternately. Thanks god, that I use this approach since I heard about it. Probably the efficiency and the time granularity there is higher. | |
Robert 21-Mar-2006 [3717x4] | How can I avoid the scientific notation? >> round/to (sm/n * sm/s * 0.9) 0.0001 == 9E-2 |
I want to get back: 0.09 | |
>> round/to (sm/n * sm/s * 1.111231) 0.0001 == 0.1111 | |
It seems that only for values < 0 the E notation is used. | |
Pekr 21-Mar-2006 [3721] | I wrote the function for it. It was debated several times, but I do not remember if some solution came-up ... |
Tomc 21-Mar-2006 [3722x2] | robert the short but usless answer is don't use windows |
other platforms do not have this behavior | |
older newer | first last |