World: r3wp
[Core] Discuss core issues
older newer | first last |
Volker 1-Mar-2006 [3632] | (the word. Not the content of the word! its quoted! ;) |
Pekr 1-Mar-2006 [3633] | well, the quote char was there simply by mistake and because I rewrote example according to initial syntax of do bind load str 'a, where 'a is quoted too ;-) |
yeksoon 1-Mar-2006 [3634] | is there a reason why 'NOW' does not have refinements for hour, minutes and seconds.? I would have thought that it make sense to provide those refinements as well..since NOW will return a value that comprise date, time and GMT offset |
PeterWood 1-Mar-2006 [3635x2] | Yes it is odd : now/time/second ** Script Error: now has no refinement called second ** Near: now/time/second >> my-time: now/time == 11:04:35 >> my-time/second == 35.0 |
One for RAMBO? | |
yeksoon 1-Mar-2006 [3637] | submitted to RAMBO |
PeterWood 1-Mar-2006 [3638x2] | An inefficient workaround : >> mod now/time 0:01 == 0:00:21 |
Oops forgot a bit : >> to decimal! mod now/time 0:01 == 32.0 | |
Ashley 2-Mar-2006 [3640] | How about: t: now/time first t second t third t |
PeterWood 2-Mar-2006 [3641x2] | I guessed that yeksoon wanted a one-line solution |
So he could use: >> third t: now/time == 56.0 | |
yeksoon 2-Mar-2006 [3643] | thanks for the one-liner solution.. but I would also like to request for additional refinements to be added to 'NOW'... it just seems more natural to me if we can use refinements for the time as well |
Ingo 5-Mar-2006 [3644x2] | How can I position the internal (imap) scheme position? I'm trying to do sth. along the lines of: i: open imap://.... insert i [get mail 7] and want to get the 7th mail ... |
and then insert i [get mail next] | |
Graham 5-Mar-2006 [3646x2] | pick i 7 ? |
oh, you want to set i to the 7th mail and then read consecutively with 'next ? | |
Ashley 5-Mar-2006 [3648] | Ever have a script that is used by other scripts but occassionaly needs to be run standalone and accessed from the console? Well I have, and my usual solution was to comment/uncomment a 'halt as the last line; but this got a bit tiresome so I came up with the following little trick: any [system/script/parent/header halt] just add it as the last line of your script and you can now run the script directly as a console script or have others scripts use it without being dropped to the console. |
Anton 6-Mar-2006 [3649] | Sounds good! What's the theory behind it ? |
Ammon 6-Mar-2006 [3650] | system/script/parent/header contains the header for a script that has DOne another script so if the parent header exists then ANY will be satisfied and the script won't halt allowing other scripts to load it but if the parent header doesn't exist ANY isn't satisfied and the script halts. This is a rather useful concept for a library where you would like to be able to test new changes at the console and run it from another script without having to modify the script depending on how you want to execute it. |
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 [3680x2] | 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) | |
older newer | first last |