World: r3wp
[Core] Discuss core issues
older newer | first last |
Maxim 17-Oct-2009 [14847] | this is just plain dumb. |
Pekr 17-Oct-2009 [14848] | the result is of course correct .. |
Steeve 17-Oct-2009 [14849] | So, do a double first >> value? first first to-block "[any {a}]" == false |
Pekr 17-Oct-2009 [14850] | and? 'any is a word. It surely does not have a value. What are you wondering about? |
Maxim 17-Oct-2009 [14851x2] | pekr it aint. if to-block doesn't bind words... it just shouldn't . how am I going to manage loading data from disk and hope it doesn't collide with some stray global word |
but I realize that all words are bound. | |
Steeve 17-Oct-2009 [14853] | Actually, to-block doesn't bound anything, what the problem so ? |
Maxim 17-Oct-2009 [14854] | ok, let me try something then. |
Steeve 17-Oct-2009 [14855] | In the old past days, to-block "[any]" was returning only one block. It's returning a double block since some versions, never understood the interest of such change. >> to-block "[any]" == [[any]] |
Maxim 17-Oct-2009 [14856x2] | ok, so parse is the root of my problem. it specifically word binding for its keywords, but looks up all other words... which is what's causing the inconsistency in my code. |
specifically *ignores* word | |
Steeve 17-Oct-2009 [14858] | I don't see your point, what you say seems wrong, can you give us an example ? |
Maxim 17-Oct-2009 [14859x2] | in my code, I was getting different results for some keywords. any is bound to global, but some isn't anything in rebol. |
so since I can't create my rules using to-block (cause the parse rule is actully changing itself, using pre-bound rules... I'm stuck. | |
Steeve 17-Oct-2009 [14861x2] | well, just bind yout rules in a specific context. con: context [ any: 'any some: 'some opt: 'op ... ] |
redefines the parse keywords as you want | |
Maxim 17-Oct-2009 [14863x2] | so what I'll do is follow parse's functioning. if a word maps to a function or a native, ignore it... I know my rules don't bind functions, cause they'd fail anyways. |
yeah that would work too. | |
BrianH 17-Oct-2009 [14865] | Maxim, BOUND? doesn't bind words to the global context - that was done by LOAD. Try this: >> bound? first to-block "a" == none |
Maxim 17-Oct-2009 [14866] | yes yes... that was understood later on. |
BrianH 17-Oct-2009 [14867] | I'm trying to hack up an UNBIND backport to R2/Forward though. |
Maxim 17-Oct-2009 [14868] | load is the core culprit here. I didn't realize that all my rules where being bound at application load time, since every word is created by load initially. |
BrianH 17-Oct-2009 [14869] | That was one of the first things changed in R3. If need be you write your own loader for R2 that uses TO-BLOCK and then does the binding itself - LOAD in R3 is a mezzanine that does the same. |
Graham 23-Oct-2009 [14870x3] | >> d: now/time == 17:11:08 >> d/1 == 17 >> d/2 == 11 >> d/3 == 8.0 >> d/3: 0 == 0 >> d == 17:11 >> d: now == 23-Oct-2009/17:11:37+13:00 >> d/4 == 17:11:37 >> d/4/3 == 37.0 >> d/4/3: 0 == 0 >> d == 23-Oct-2009/17:11:37+13:00 >> t: d/time == 17:11:37 >> t/3: 0 == 0 >> d/time: t == 17:11 >> d == 23-Oct-2009/17:11+13:00 |
I can change the second component of a time! but now when it is part of date! ??? | |
but not ... | |
Maxim 23-Oct-2009 [14873x3] | date doesn't have accessors for individual time values... |
once you use d/time, its a new value of type time! | |
you have to use d/time: t in order to push it back into the date. | |
Graham 23-Oct-2009 [14876] | inconsistent |
Maxim 23-Oct-2009 [14877] | I would have tought R3 would have addressed this, but it hasn't :-( ... I just checked |
Graham 23-Oct-2009 [14878x3] | >> date: now == 23-Oct-2009/19:31:27+13:00 >> type? date/time == time! >> date/time/3 == 27.0 >> date/time/3: 0 == 0 >> date == 23-Oct-2009/19:31:27+13:00 |
What exactly is the explanation here?? | |
I'm accessing a time value .. not a date value | |
Maxim 23-Oct-2009 [14881x2] | date is a point in time... time is an amount of time... they aren't the same thing. you can have time values with 50 hours in them, but you can't have 50 hour days. |
but I would like to be able to interact with the time within a date directly anyways myself. | |
Graham 23-Oct-2009 [14883] | Lets put it in curecode |
Maxim 23-Oct-2009 [14884x2] | yep. it might already be there as a request. |
the issue probably is that if you did date/hours: 50 its a logic error. so how is it resolved? ... an error... add two days, two hours? | |
Graham 23-Oct-2009 [14886] | You can alter the day, month, year and zone ... just not the time |
Maxim 23-Oct-2009 [14887x4] | there is a bug in any case!!! >> t: 50:00 == 50:00 >> d: now == 23-Oct-2009/2:40:09-4:00 >> d/time: t == 50:00 >> d == 25-Oct-2009/2:00-4:00 |
here it seems it added two days ... but didn't add the 2 extra hours !! | |
so, I guess the handling wasn't speicifically designed by the date object, and is simply a side effect of its internals. | |
(thats in R2 A90) | |
Graham 23-Oct-2009 [14891] | actually all i wanted to do was to round the time off to remove all the seconds |
Maxim 23-Oct-2009 [14892] | *R3* |
Graham 23-Oct-2009 [14893] | but I have to extract the time, round it off and then set the date time value back :( |
Maxim 23-Oct-2009 [14894] | put it into curecode and add the above bug within the report... it will add to its relevance (and priority) within the post. |
Graham 23-Oct-2009 [14895] | I don't hve the link close to hand ... |
Maxim 23-Oct-2009 [14896] | google rebol curecode... first link |
older newer | first last |