[Issue 5765] ^^ and with BigInts

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5765


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au


--- Comment #1 from Don clugd...@yahoo.com.au 2011-03-22 00:39:07 PDT ---
Those operations could easily be allowed. But it's not an accident that they're
not currently implemented. The question is, is it a good idea?

anything ^^ BigInt  and anything  BigInt will ALWAYS overflow, if the BigInt
doesn't actually fit into an int.

So except for a few toy cases, such as the example here, such operations are
always bugs in the user's code.
Do we really want to allow such a bug-prone operation which provides no useful
functionality?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5766] New: undefined reference to `_D3std4bind12__ModuleInfoZ'

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5766

   Summary: undefined reference to `_D3std4bind12__ModuleInfoZ'
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: chang...@gmail.com


--- Comment #0 from changlon chang...@gmail.com 2011-03-22 01:17:19 PDT ---
I am not sure this is a dmd or phobos bug,  I use dmd 2.052 build and pass this
in windows, I use gdc v2 build this on linux,  and all code is execute correct
but cat a Segmentation fault at /lifetime.d:1122 ( see
https://bitbucket.org/goshawk/gdc/issue/171/segmentation-fault-on-linux) .


I build this project on linux 32 and 64 version both cacht this error , the dmd
version is dmd2.052 release and download form ftp.digitalmars.com

jade2test.o:(.data+0x197c): undefined reference to `_D3std4bind12__ModuleInfoZ'
collect2: ld returned 1 exit status
--- errorlevel 1


the source code is here :
http://gool.googlecode.com/files/jade_dmd_bug.tar.bz2

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5766] undefined reference to `_D3std4bind12__ModuleInfoZ'

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5766



--- Comment #1 from changlon chang...@gmail.com 2011-03-22 01:41:18 PDT ---
I am wrong about the windows can pass this ,  I am not woring on windows
recently . The latest time I check it still build and pass on windows .

Now I check agian , The windows throw the same error like GDC dose ,

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc005) at _rt_finalize
(0x0045db0e) thread(1256)
-Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc005) at _rt_finalize
(0x0045db0e) thread(1256) .

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5765] ^^ and with BigInts

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5765



--- Comment #2 from bearophile_h...@eml.cc 2011-03-22 02:29:39 PDT ---
Here n needs to be a BigInt, because of the second recursive call. So instead
of writing 2^^n you need to write BigInt(2)^^n.toInt() that's not natural (this
code will probably work in DMD 2.053 thanks to a -0 bug you have fixed):


import std.stdio, std.bigint;

/// Optimized Ackermann function
BigInt ackermann(int m, BigInt n) {
if (m == 0) return n + 1;
if (m == 1) return n + 2;
if (m == 2) return 3 + n * 2;
//if (m == 3) return 5 + 8 * (2 ^^ n - 1);
if (m == 3) return 5 + 8 * (BigInt(2) ^^ n.toInt() - 1);
if (n == 0)
return ackermann(m - 1, BigInt(1));
else
return ackermann(m - 1, ackermann(m, n - 1));
}

void main() {
writeln(ackermann(4, BigInt(2)));
}


Equivalent Python2.6 code that works:


def ackermann(m, n):
Optimized Ackermann function
if m == 0: return n + 1
if m == 1: return n + 2
if m == 2: return 3 + n * 2
if m == 3: return 5 + 8 * (2 ** n - 1)
if n == 0:
return ackermann(m - 1, 1)
else:
return ackermann(m - 1, ackermann(m, n - 1))

assert len(str(ackermann(4, 2))) == 19729

--

Two little about BigInt (maybe it's wrong to put those in this bug report):

How do I perform the equivalent of str(ackermann(4, 2)) with BigInt?

The bottom of this page shows a duplication to me:
http://www.digitalmars.com/d/2.0/phobos/std_bigint.html

The output format is controlled via formatString:
The output format is controlled via formatString: d Decimal
x Hexadecimal, lower case
X Hexadecimal, upper case
s Default formatting (same as d)
null Default formatting (same as d)
d Decimal
x Hexadecimal, lower case
X Hexadecimal, upper case
s Default formatting (same as d)
null Default formatting (same as d)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5767] New: Optlink crash

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5767

   Summary: Optlink crash
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: Optlink
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic andrej.mitrov...@gmail.com 2011-03-22 
15:08:43 PDT ---
Using: OPTLINK (R) for Win32  Release 8.00.11

No test case yet.
If I comment out just one call to writefln(), then the linker won't crash.
Otherwise it crashes with:

---
Unexpected OPTLINK Termination at EIP=
---
EAX=0001 EBX=0034 ECX= EDX=003C 
ESI=00441BD0 EDI=02540008 EBP=0012FFF0 ESP=0012FF8C 
First=00402000
---

The project has about 20 files divided into libraries, about 6000 lines. So
here's what I'll do: If I can successfully compile my project with GDC, then I
won't bother even with Optlink. Otherwise I'll do what I can to make a simple
test case.

Have I mentioned how much I hate Optlink?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5767] Optlink crash

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5767


changlon chang...@gmail.com changed:

   What|Removed |Added

 CC||chang...@gmail.com


--- Comment #1 from changlon chang...@gmail.com 2011-03-22 18:04:38 PDT ---
There is a optlink 8.00.12, you may want try it .

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3836] [TDPL] obligatory override attribute

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3836


Jonathan M Davis jmdavisp...@gmx.com changed:

   What|Removed |Added

 CC||jmdavisp...@gmx.com
Summary|obligatory override |[TDPL] obligatory override
   |attribute   |attribute


--- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2011-03-22 18:16:39 
PDT ---
override is obligatory according to TDPL.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5767] Optlink crash

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5767



--- Comment #2 from Andrej Mitrovic andrej.mitrov...@gmail.com 2011-03-22 
18:25:01 PDT ---
Nope, same results. On the other hand it looks like I'll be able to use GDC.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5768] New: std.uni's is* functions should return bool

2011-03-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5768

   Summary: std.uni's is* functions should return bool
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky cbkbbej...@mailinator.com 2011-03-22 
22:27:18 PDT ---
Currently, these functions return int, but they really should be made to return
bool:

std.uni.isUniLower
std.uni.isUniUpper
std.uni.isUniAlpha

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---