Robert Virding | 1 Mar 2010 04:19
Picon

Re: module name with .

Ah, so there is documentation. But I must say it has been put in a
place where I would definitely not look for it, among the kernel
documentation, as it is not something you call.

And I think that as it is something experimental you should have to
turn it on to use it, it should not *always* be there. The two other
experimental features, parametrised modules and extends, are better in
this respect in that you actually have to explicitly do something to
get them.

There was another thread which discussed the existence of parametrised
modules and packages briefly appeared there as well (introduced by
me). And, as I stated there, I don't see the need for either of them.

Robert

On 28 February 2010 18:29, Richard Carlsson <carlsson.richard <at> gmail.com> wrote:
> Not that poorly documented (under kernel):
>
>  http://www.erlang.org/doc/man/packages.html
>
> And no, you can't have a source file named "fm2.2.erl".
>
>    /Richard
>
> Robert Virding wrote:
>>
>> My guess is that you are interacting with the experimental, and poorly
>> documented, package system which assumes things when it sees module
>> names with '.'. As far as I know there is no way to turn this off.
(Continue reading)

Sergei Fomin | 1 Mar 2010 15:05
Picon

Wrong gregorian date

Hello.

It seems a part of calendar library thinks there is February 29, 2010.

# date +%s
1267451701

Eshell V5.7.4  (abort with ^G)
1> calendar:gregorian_seconds_to_datetime(1267451701).
{{40,2,29},{13,55,1}}

Best regards,
Sergei Fomin

________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-bugs-unsubscribe <at> erlang.org

Sergei Fomin | 1 Mar 2010 15:37
Picon

Re: Wrong Gregorian date

Oh, my fault.
Thank you.

Best regards,
Sergei Fomin

Trevor Woollacott [ MTN - Innovation Centre ] wrote:
> Hi Sergei
> 
> Date +%s does not return the date and time in Gregorian seconds, rather the number of seconds since
1970-01-01 00:00:00 UTC. If you try to convert the number of seconds since 1970 back to into the date & time
tuple it correctly calculates the year at 40AD, which is a leap year.
> 
> Regards,
> Trevor
> 
> 
> -----Original Message-----
> From: erlang-bugs <at> erlang.org [mailto:erlang-bugs <at> erlang.org] On Behalf Of Sergei Fomin
> Sent: Monday, 01 March 2010 04:05 PM
> To: erlang-bugs <at> erlang.org
> Subject: [erlang-bugs] Wrong gregorian date
> 
> Hello.
> 
> It seems a part of calendar library thinks there is February 29, 2010.
> 
> # date +%s
> 1267451701
> 
(Continue reading)

Picon

RE: Wrong Gregorian date

Hi Sergei

Date +%s does not return the date and time in Gregorian seconds, rather the number of seconds since
1970-01-01 00:00:00 UTC. If you try to convert the number of seconds since 1970 back to into the date & time
tuple it correctly calculates the year at 40AD, which is a leap year.

Regards,
Trevor

-----Original Message-----
From: erlang-bugs <at> erlang.org [mailto:erlang-bugs <at> erlang.org] On Behalf Of Sergei Fomin
Sent: Monday, 01 March 2010 04:05 PM
To: erlang-bugs <at> erlang.org
Subject: [erlang-bugs] Wrong gregorian date

Hello.

It seems a part of calendar library thinks there is February 29, 2010.

# date +%s
1267451701

Eshell V5.7.4  (abort with ^G)
1> calendar:gregorian_seconds_to_datetime(1267451701).
{{40,2,29},{13,55,1}}

Best regards,
Sergei Fomin

________________________________________________________________
(Continue reading)

Alex Kutsko | 1 Mar 2010 16:29
Favicon

Re: Wrong gregorian date

But the date you provided is not gregorian seconds.
try
calendar:datetime_to_gregorian_seconds({date(),time()}).
63434683473
.
The result you actually got is February 29, 2040 - you can ensure that this
year is leap year :).

On Mon, Mar 1, 2010 at 4:05 PM, Sergei Fomin <dafgar <at> yandex-team.ru> wrote:

> Hello.
>
> It seems a part of calendar library thinks there is February 29, 2010.
>
> # date +%s
> 1267451701
>
> Eshell V5.7.4  (abort with ^G)
> 1> calendar:gregorian_seconds_to_datetime(1267451701).
> {{40,2,29},{13,55,1}}
>
>
> Best regards,
> Sergei Fomin
>
>
>
> ________________________________________________________________
> erlang-bugs (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
(Continue reading)

Alex Kutsko | 1 Mar 2010 16:33
Favicon

Re: Wrong gregorian date

Sorry to be precise you've got February, 29 of 0040 year

On Mon, Mar 1, 2010 at 5:29 PM, Alex Kutsko <alex.kutsko <at> itteco.com> wrote:

> But the date you provided is not gregorian seconds.
> try
> calendar:datetime_to_gregorian_seconds({date(),time()}).
> 63434683473
> .
> The result you actually got is February 29, 2040 - you can ensure that this
> year is leap year :).
>
>
>
> On Mon, Mar 1, 2010 at 4:05 PM, Sergei Fomin <dafgar <at> yandex-team.ru>wrote:
>
>> Hello.
>>
>> It seems a part of calendar library thinks there is February 29, 2010.
>>
>> # date +%s
>> 1267451701
>>
>> Eshell V5.7.4  (abort with ^G)
>> 1> calendar:gregorian_seconds_to_datetime(1267451701).
>> {{40,2,29},{13,55,1}}
>>
>>
>> Best regards,
>> Sergei Fomin
(Continue reading)

Manolis Papadakis | 1 Mar 2010 17:16
Picon
Gravatar

Yecc bug (possibly related to mutually recursive rules)

This grammar file:

Nonterminals elem seq.
Terminals 'foo' 'bar' ':'.
Rootsymbol elem.
elem -> 'foo'.
elem -> 'bar'.
elem -> seq.
seq -> elem.
seq -> seq ':' elem.
% or seq -> elem ':' seq.

when fed to yecc (git version) produces this error:

2> yecc:file("bug.yrl").

=ERROR REPORT==== 1-Mar-2010::18:16:06 ===
Error in process <0.36.0> with exit value:
{function_clause,[{yecc,find_reduce_reduce,[[accept,{reduce,10,seq,1,{0,none},undefined}],{cxt,'$end',2,{yecc,"bug.yrl","bug.erl",[],{1,2},bug,[file_attributes,{includefile,[]},{parserfile,[]},report_errors,report_warnings],false...

** exception exit: function_clause
     in function  yecc:find_reduce_reduce/2
        called as
yecc:find_reduce_reduce([accept,{reduce,10,seq,1,{0,none},undefined}],
                                          {cxt,'$end',2,
                                               {yecc,"bug.yrl","bug.erl",[],
                                                     {1,2},
                                                     bug,
                                                     [file_attributes,
                                                      {includefile,[]},
(Continue reading)

J K | 2 Mar 2010 00:06
Picon
Favicon

Re: module name with .

Well... hehe, I know... i must have had a blackout or something...

----- Original Message ----
From: Bernard Duggan <bernie <at> m5net.com>
To: J K <jmakarlsson <at> yahoo.com>
Cc: Erlang Bugs <erlang-bugs <at> erlang.org>
Sent: Sun, February 28, 2010 10:54:19 PM
Subject: Re: [erlang-bugs] module name with .

Actually, all these look pretty much as I'd expect:

J K wrote:
> I tried comma just for "fun":
>
> 254> c(fm2,2).                
> ./fm2.erl:none: no such file or directory
> error
>  
By putting a comma there you've passed two parameters to the 'c'
function.  While the shell docs don't seem to mention it, a quick glance
at the source shows that there is indeed a c/2 where the second
parameter is the compilation options.  So you're trying to compile a
module called 'fm2' with an option of 2 (which probably doesn't mean
anything, but the missing file is the first problem that is picked up).

> 255> compile:file(fm2,2.erl).  
> * 1: illegal expression
>  
Here, you've put a full stop/period in the middle of an expression
(prior to closing the parentheses).  That's the character the ends
(Continue reading)

Thijs Terlouw | 2 Mar 2010 05:33
Picon
Gravatar

Re: Wrong gregorian date

So Sergei should use :

calendar:gregorian_seconds_to_datetime(1267451701+62167219200).

Where does that magic number "62167219200" come from? Here:
calendar:datetime_to_gregorian_seconds({{1970, 1, 1}, {0,0,0}}).

Thijs Terlouw
Shenzhen, China,
http://www.startinchina.com/

On Mon, Mar 1, 2010 at 11:33 PM, Alex Kutsko <alex.kutsko <at> itteco.com> wrote:
> Sorry to be precise you've got February, 29 of 0040 year
>
> On Mon, Mar 1, 2010 at 5:29 PM, Alex Kutsko <alex.kutsko <at> itteco.com> wrote:
>
>> But the date you provided is not gregorian seconds.
>> try
>> calendar:datetime_to_gregorian_seconds({date(),time()}).
>> 63434683473
>> .
>> The result you actually got is February 29, 2040 - you can ensure that this
>> year is leap year :).
>>
>>
>>
>> On Mon, Mar 1, 2010 at 4:05 PM, Sergei Fomin <dafgar <at> yandex-team.ru>wrote:
>>
>>> Hello.
>>>
(Continue reading)

Hans Bolinder | 2 Mar 2010 12:19
Picon
Favicon

Re: Yecc bug (possibly related to mutually recursive rules)

[Manolis Papadakis:]
> This grammar file:
> 
> Nonterminals elem seq.
> Terminals 'foo' 'bar' ':'.
> Rootsymbol elem.
> elem -> 'foo'.
> elem -> 'bar'.
> elem -> seq.
> seq -> elem.
> seq -> seq ':' elem.
> % or seq -> elem ':' seq.
> 
> when fed to yecc (git version) produces this error:
> 
> 2> yecc:file("bug.yrl").
...
> ** exception exit: function_clause
>      in function  yecc:find_reduce_reduce/2
>         called as
> yecc:find_reduce_reduce([accept,{reduce,10,seq,1,{0,none},undefined}],
...

Thanks. The bug will be fixed in R14A.

In the meantime, to get the error report, you can add a dummy rule:

  Rootsymbol RS.
  RS -> elem.

(Continue reading)


Gmane