reservastranc...@gmail.com Pousadas em Trancoso, reservas, agencia virtual, turismo Bahia - 07995

2011-10-12 Thread pousadas trancoso reservas bahia
reservastranc...@gmail.com
reservastrancoso @ gmail.com
(reservastranc...@gmail.com)

Pousadas em Trancoso, agencia virtual em Tancoso - Bahia. Faça ja sua reserva 
nas pousadas mais badaladas da cidade. 


Contato reservastrancoso @ gmail.com
reservastranc...@gmail.com 
(reservastranc...@gmail.com)

Hjt,=lafcQGHOwX(*iJIR%%p#


[Issue 6806] New: struct TS(size_t){} instantiates in distinct types by `1` and `1u`

2011-10-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6806

   Summary: struct TS(size_t){} instantiates in distinct types by
`1` and `1u`
   Product: D
   Version: D1  D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: verylonglogin@gmail.com


--- Comment #0 from Denis verylonglogin@gmail.com 2011-10-12 12:42:00 PDT 
---
The main bug is:
---
struct TS(size_t n) { }
static assert(is(TS!(1u) == TS!(1)));
---
main.d(2): Error: static assert  (is(TS!(1u) == TS!(1))) is false

The second is a minor naming 2 only bug:
---
struct TS(size_t k) { }

TS!(n) get(size_t n)() { return TS!(n)(); }

void main()
{
//get!(1)(); //uncomment to enable D2 only type naming bug

// The next line produces `assert(is(TS!(@@@) == TS!(1))) is false` error
// where @@@ is replaced by `1u` if `get` call is commented, and by `n`
otherwise.
static assert(is(TS!(1u) == TS!(1))); 
}
---

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


[Issue 4705] Redesign of std.algorithm.max()/min() + mins()/maxs()

2011-10-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4705



--- Comment #13 from bearophile_h...@eml.cc 2011-10-12 15:55:39 PDT ---
Part of A comment by Andrei Alexandrescu:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.Darticle_id=144562

 Second, you propose
 
 mins(collection)
 mins!(callable)(collection)
 maxs(collection)
 maxs!(callable)(collection)
 
 that return all elements. I'm not sure how you plan to return - create a
 new array, or iterate a la filter? The latter is interesting, but for
 either variant is quite difficult to find use examples that are frequent
 enough to make min followed by filter too verbose.

It's not a problem of verbosity. If you have to find all the min or max items
of a lazy iterable, and you want to use min followed by filter, then you have
to scan the sequence two times. This is a problem because:
- Two scans are a waste of time if the sequence is a large array, because of
CPU cache issues.
- It becomes worse if the sequence is a lazy range, because you have to compute
every item two times. This is sometimes not acceptable. I have found situations
like this, where the range was coming from a map with a costly mapping
function.

So maxs/mins is a common enough pattern (I have just hit another use case),
it's not trivial to implement manually (because you have to efficiently manage
the cache of the max/min items found so far), and I think it can't be trivially
and efficiently implemented using existing std.range/std.algorithm tools. This
makes it a worth candidate for a specilized higher order function.

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


[Issue 6808] New: string to BigInt using std.conv.to

2011-10-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6808

   Summary: string to BigInt using std.conv.to
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-10-12 16:18:01 PDT ---
For generic code, and to run functions with both integers and bigintegers, I'd
like to use bigintegers in many of the situations where I use ints (I don't
expect to use bigintegers everywhere, like as array indexes).

The BigInt struct allows the conversion of a string to a BigInt, but you have
to use a specific syntax for that:


import std.conv, std.bigint;
void main() {
string s = 101;
auto i1 = to!int(s); // OK
auto i2 = BigInt(s); // OK
}



So if possible I'd like to use the normal to! syntax to convert a string to
BigInt:

import std.conv, std.bigint;
void main() {
string s = 101;
auto i3 = to!BigInt(s); // Error
}


Is this possible?


With DMD 2.056head the second program gives:

...dmd2\src\phobos\std\conv.d(227): Error: template std.conv.toImpl(T,S) if
(isImplicitlyConvertible!(S,T)) toImpl(T,S) if (isImplicitlyConvertible!(S,T))
matches more than one template declaration,
...dmd2\src\phobos\std\conv.d(434):toImpl(T,S) if
(!isImplicitlyConvertible!(S,T)  is(T == struct)  is(typeof(T(src and
...dmd2\src\phobos\std\conv.d(1726):toImpl(T,S) if (isDynamicArray!(S) 
isSomeString!(S)  !isSomeString!(T))

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


[Issue 6329] Out of range exceptions not thrown in certain cases

2011-10-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6329



--- Comment #7 from Andrej Mitrovic andrej.mitrov...@gmail.com 2011-10-12 
16:35:00 PDT ---
Here's more issues, this time the sample tries to write to a file handle that
was opened in read-only mode:

import std.stdio;
import std.file;

void main()
{
foreach (string entry; dirEntries(., SpanMode.shallow))
{
auto file = File(entry, r);

string[] lines;
foreach (line; file.byLine)
{
lines ~= line.idup;
}

foreach (line; lines)
{
file.writeln(asdf);
}
}
}

$ dmd test.d  test.exe

Nothing is outputted. But with -g:

$ dmd -g test.d  test.exe
$
std.exception.ErrnoException@D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\stdio.d(1164):
 (No error)

So without the symbolic info I get nothing in stdout. However If I change the
sample to this:

import std.stdio;
import std.file;

void main()
{
foreach (string entry; dirEntries(., SpanMode.shallow))
{
auto file = File(entry, r);
file.writeln(asdf);
}
}

$ dmd test.d  test.exe
object.Error: Access Violation
..

and this error message will loop forever.

But with -g I only get one error message as it should be:
$ dmd -g test.d  test.exe
$
std.exception.ErrnoException@D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\stdio.d(1164):
 (No error)

So I'll just have to compile with -g all the time until this gets resolved.

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


[Issue 3425] StdioException on end of stdin on Windows

2011-10-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3425


Jay Norwood j...@prismnet.com changed:

   What|Removed |Added

 CC||j...@prismnet.com


--- Comment #2 from Jay Norwood j...@prismnet.com 2011-10-12 20:03:13 PDT ---
You can work around the issue by testing for eof  on the first line in the
loop. This works with no error.   

foreach(elem; stdin.byLine()) {
if (stdin.eof()) break;
writeln(elem);
}

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