World: r3wp
[Core] Discuss core issues
older newer | first last |
Gabriele 10-Mar-2009 [12870x2] | Brian, right, if we had DO in PARSE, there would be no need for DO/NEXT. |
If you prefer using 'a instead of a in the example above, thus being different from FOREACH, then you can just use reduce. | |
Steeve 10-Mar-2009 [12872] | Brian, by separating words and data, do you mean this format ? >> nforeach [a [b c]] [[123][456789]] [print [a b c]] |
BrianH 11-Mar-2009 [12873x4] | Yes, Steeve. The implementation wouldn't need DO/next at all, or anything like it. |
Gabriele, if we had DO in PARSE we would still need DO/next. Just not for nforeach - neither DO/next nor DO in PARSE would be appropriate there. Nor would REDUCE be needed. All you'd need would be BIND/copy and SET, and some loop function. | |
We would probably want to skip the set-word behavior of R3's FOREACH, but if we need it it can be compiled - I did so for MAP in R2. | |
Gabriele, I'm having a little trouble finding your request for the DO operation in R3 chat, under the R3/Parse heading (28). I already added your DO proposal to the official Parse Proposals page months ago (with some semantic cleanup) but if you don't speak up in the discussion forum then I will have more trouble convincing Carl. Any requests for it here might as well be thrown away - they will be long gone before we get to PARSE. | |
Steeve 11-Mar-2009 [12877] | Was lazzy, so i made the nforeach brian's version. nforeach: func [ vars [block!] data [block!] body [block!] /local ctx n ][ data: copy data vars: copy vars ctx: make object! 5 forall vars [change/only vars bind/new to block! vars/1 ctx] ;** convert all vars to blocks of vars (set need it) while [ n: 1 also not tail? first data forall vars [ poke data n skip set first vars pick data ++ n length? first vars ] ] bind/copy body ctx ] |
Graham 12-Mar-2009 [12878x6] | this is Ladislav's function to find out if your PC is out. get-nist-correction: func [/local nist-time cpu-time mjd hms] [ nist-time: read daytime://time.nist.gov cpu-time: now parse/all nist-time [skip copy mjd 5 skip 2 thru " " copy hms 8 skip] nist-time: 17/Nov/1858 + to integer! mjd nist-time/time: to time! hms nist-correction: difference nist-time cpu-time ] |
it basically parses the text string returned by the daytime server, and works out what utc is ( nist-time ) | |
it then displays the difference between utc and your pc time. | |
now, when I set my pc clock to canadian time, or EDT ( -0400 ), on vista, Rebol says timezone is -3 and not -4 | |
Dunno what it does in XP ... | |
anyway, now the nist correction is now 1 hour out :( | |
Gregg 12-Mar-2009 [12884x2] | connecting to: time.nist.gov == 0:00:03 |
XP x64 | |
Graham 12-Mar-2009 [12886] | what time zone? |
Gregg 12-Mar-2009 [12887] | US Mountain time (-6:00 right now) |
Graham 12-Mar-2009 [12888] | what happens if you change to EDT ? Does Rebol report the time zone correctly? |
Maxim 12-Mar-2009 [12889x2] | on my system, with the patch installed yes. |
(XP) | |
Graham 12-Mar-2009 [12891] | what patch? |
Maxim 12-Mar-2009 [12892x4] | the XP fixing of timezones... |
if you have updates, it should have been rolled in a long time ago. | |
the tz rules have to be updated every few years... | |
it seems. | |
Graham 12-Mar-2009 [12896x2] | I'm on Vista |
so are you at -3 or -4 now? | |
Maxim 12-Mar-2009 [12898x2] | since vista crapped on reboot... I have turned away. I mean destroying your own MBR while booting is a pretty bad bug... It was partway booting. |
-4 | |
Gregg 12-Mar-2009 [12900] | Last year was the big TZ update here. |
Maxim 12-Mar-2009 [12901] | so I installed XP (30 hours of work mind you) |
Graham 12-Mar-2009 [12902] | Hmm.. so why when I change to canadian time in vista, does Rebol say I'm at -3 ? |
Maxim 12-Mar-2009 [12903x3] | when it normally takes me 1-2 hours... |
EST? | |
EDT? | |
Graham 12-Mar-2009 [12906] | Atlantic time |
Maxim 12-Mar-2009 [12907x2] | thats correct. |
-3 is the current atlantic time... eastern is at -4 | |
Graham 12-Mar-2009 [12909] | Atlantic time is -3 ? |
Maxim 12-Mar-2009 [12910x4] | yess sir |
in DST it is | |
and we have shifted last week-end. | |
before europe, AFAIK | |
Graham 12-Mar-2009 [12914] | I'm getting reports that my app is complaining that the time is 1 hour out :( |
Anton 12-Mar-2009 [12915x2] | Could it be daylight saving time ? |
http://en.wikipedia.org/wiki/Atlantic_Time | |
Maxim 12-Mar-2009 [12917] | yep... DST |
Graham 12-Mar-2009 [12918] | What's the time in Ontario now? 00:42 ? |
Anton 12-Mar-2009 [12919] | WinXP has an option to automatically adjust time during daylight savings. I suspect Rebol gets confused by that. |
older newer | first last |