Add %z (timezone) handling in Date code. #34

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@alokmenghrajani

This diff does not add total timezone handling (i.e. it doesn't allow you to parse the timezone from a string and/or mess around with timezone values). The main purpose of this diff is to have the ability to tell which timezone the server or client is running in, which is sometimes useful.

Alok Menghrajani Add %z (timezone) handling in Date code.
This diff does not add total timezone handling (i.e. it doesn't allow you to parse the timezone from a string and/or mess around with timezone values). The main purpose of this diff is to have the ability to tell which timezone the server or client is running in, which is sometimes useful.
90e2f5f
@alokmenghrajani

Note: I might have hit some bug with the bsl. If I try to make local_timezone_offset a nullary function, I end up with weird warnings:

opabsl/jsbsl/opabslgen_bslTime.js.pp:181: ERROR - Parse error. invalid return
return t.getTimezoneOffset();

(see https://gist.github.com/1734181).

@BourgerieQuentin

Alok, you have just missing ##args() on bsl register declaration.
Then I also correct Opa compile error (on date_private.opa)

see https://gist.github.com/1752783 it's just your https://gist.github.com/1734181 patch with corrections.

I commited the patch on our repository. (Sure I authored to you)

Thanks

@alokmenghrajani

I applied your corrected patch and it works, thanks!

I didn't know I needed the empty ##args(). Why doesn't ##register now
now : -> time_t have this too?

Alok

On 2/6/12 7:52 AM, "BourgerieQuentin"
<reply+i-3091113-aee02df16e01c5aeac0aab113b9bce6a65036ef4-441307@reply.gith
ub.com> wrote:

Alok, you have just missing ##args() on bsl register declaration.
Then I also correct Opa compile error (on date_private.opa)

see https://gist.github.com/1752783 it's just your
https://gist.github.com/1734181 patch with corrections?

Thanks


Reply to this email directly or view it on GitHub:
#34 (comment)

@BourgerieQuentin
#register x \ y : 'a, 'b -> 'c

means "Register as 'x' the javascript function 'y' and it should respect the given signature ''a, 'b -> 'c'"
i.e is just like an alias.

This case is usefull when the function who want register is already defined.

In the case of 'now' indeed the implementation is just bellow the register declaration. And can be replaced by

##register now : -> time_t
##args()
{
...
}

2 -

##register x : 'a, 'b -> 'c
##args(a, b)
{
//code
}

means "Register as 'x' a javascript function with two arguments "a, b" and the following body"

Note : this way to register make some check (ex: cheking if the arity match).
And generates skeleton of javascript function.

I hope my explanations are clear enough.

Quentin.

@alokmenghrajani

Hey,

When I look at
14af0ab
918e908, I have the feeling you didn't pull my request. Also, when I
pulled from upstream today, I don't see any of my changes. Any idea what's
going on?

Alok

On 2/8/12 2:10 AM, "BourgerieQuentin"
<reply+i-3091113-aee02df16e01c5aeac0aab113b9bce6a65036ef4-441307@reply.gith
ub.com> wrote:

#register x \ y : 'a, 'b -> 'c
means "Register as 'x' the javascript function 'y' and it should respect
the given signature ''a, 'b -> 'c'"
i.e is just like an alias.

This case is usefull when the function who want register is already
defined.

In the case of 'now' indeed the implementation is just bellow the
register declaration. And can be replaced by
##register now : -> time_t
##args()
{
...
}

2 -
##register x : 'a, 'b -> 'c
##args(a, b)
{
//code
}
means "Register as 'x' a javascript function with two arguments "a, b"
and the following body"

Note : this way to register make some check (ex: cheking if the arity
match).
And generates skeleton of javascript function.

I hope my explanations are clear enough.

Quentin.


Reply to this email directly or view it on GitHub:
#34 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment