World: r3wp
[Core] Discuss core issues
older newer | first last |
Allen 6-Mar-2006 [3651] | perhaps it could be added as a refinement to halt ? such as halt/ only or halt/console or something like that. |
yeksoon 7-Mar-2006 [3652] | is this a bug? == >> now/zone == 8:00 >> now/zone + 60 == 8:01 |
Rebolek 7-Mar-2006 [3653] | No it is not. Integer! in this case is considered as seconds. |
PeterWood 7-Mar-2006 [3654] | Purely a matter of opinion.... or raather a couple of opinions... Should now be immutable? Of course not unless you want to reset the time on the machine for testing. Can a timeone take the value 8:01 - not in real life at the moment - I came across this odd behaviour when investigating the difference between mydate/zone: and to-date. I found out that there are a few :30 minute timezones and a couple of 0:15 (or 0:45) time zones, the rest were all hours. |
yeksoon 7-Mar-2006 [3655] | I see. More like a fundamental flaw in my own assumptions that timezone are separated in hours |
PeterWood 7-Mar-2006 [3656] | but you still have a point - today the only four valid values for minutes are 00, 15, 30 and 60 - and I don't think they are that likely to change. |
yeksoon 7-Mar-2006 [3657] | it become 'confusing' in a way when you are dealing with 'time components |
PeterWood 7-Mar-2006 [3658x2] | I feel that it would be a worthwhile improvement to restrict time zones to 15 minute intervals but the powers that Rambo didn't agree when I last auggested it. |
auggested -> suggested | |
Graham 7-Mar-2006 [3660x2] | since timezones are arbitrarily divided this way, I would suggest leaving it alone. |
a political decision should not force RT to change a datatype. | |
PeterWood 7-Mar-2006 [3662x2] | That counts out Unicode then ;-))) |
By the way, one of the two places with a 15 minute offset is part of NZ. | |
Sunanda 7-Mar-2006 [3664] | There have been timezones in living history with an offset of 20min (I forget where), so it is possible that it could happen again/ |
Louis 7-Mar-2006 [3665] | I have a file containing data in the following format: acmacks "Arkansas City Missionary Baptist Church, Arkansas City, KS" aslcut "Anchor Baptist Church, Salt Lake City, UT" awmi "Antioch Baptist Church, Warren, MI" bamo "Bethany Baptist Church, Ava, MO" bbin "Berean Baptist Church, Batesville, IN" bbmcanada "Bible Baptist Church, Brandon, Manitoba" bcbctx "Bay City Baptist Church, Bay City, TX" bdtx "Bible Baptist Church, Dumas, TX" beok "Bible Baptist Church, Enid, OK" How can I sort this data on the second string? |
Claude 7-Mar-2006 [3666x4] | see here http://www.rebol.net/cookbook/ |
and here http://www.rebol.net/cookbook/recipes/0012.htmlfor Louis | |
and this function [ sort-db: func [db field [word!] /local result offset] [ offset: find fields field either offset [offset: index? offset][ print ["ERROR:" field "does not exist"] halt ] db: copy db sort/compare db func [a b] [ if a/:offset = b/:offset [return 0] either a/:offset > b/:offset [1][-1] ] db ] | |
] | |
Louis 7-Mar-2006 [3670] | Thanks Claude! I just found some old code. This also works: sort/skip/compare/all codes-block 2 func [a b] [return either a/2 < b/2 [-1][either a/2 = b/2 [0][ +1]]] |
Ashley 7-Mar-2006 [3671] | sort/skip/compare codes-block 2 2 |
Louis 7-Mar-2006 [3672] | What is the second 2 for, Ashley? |
JaimeVargas 7-Mar-2006 [3673] | One specifies the size of the record and the second one the column to use. |
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 [3700] | 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? |
older newer | first last |