On Wed, 02 Feb 2011 18:38:02 +0100, spir wrote:
> On 02/02/2011 02:18 PM, Lars T. Kyllingstad wrote:
>> On Wed, 02 Feb 2011 13:26:39 +0100, spir wrote:
>>
>>> Hello,
>>>
>>> This bit of code for arrays:
>>>
>>> Out[] map (In,Out) (In[
On Wed, 02 Feb 2011 17:35:50 +0100, spir wrote:
> On 02/02/2011 04:20 PM, Lars T. Kyllingstad wrote:
>> On Wed, 02 Feb 2011 15:55:53 +0100, spir wrote:
>>
>>> Hello,
>>>
>>> What are the default semantics for '==' on structs?
>>>
>
On Thu, 03 Feb 2011 13:05:00 +0100, spir wrote:
> On 02/03/2011 08:41 AM, Lars T. Kyllingstad wrote:
>> On Wed, 02 Feb 2011 18:38:02 +0100, spir wrote:
>
>>> I guess the only solution would be for the compiler to support a kind
>>> of reange type syntax?
>>
&
On Thu, 03 Feb 2011 13:53:44 +0100, spir wrote:
> On 02/03/2011 01:17 PM, Lars T. Kyllingstad wrote:
>> Why the reluctance to use template constraints? They're so flexible!
>> :)
>
> I cannot stand the "is()" idiom/syntax ;-) Dunno why. Would happily get
On Thu, 03 Feb 2011 19:11:04 +0100, spir wrote:
> On 02/03/2011 02:25 PM, Lars T. Kyllingstad wrote:
>> On Thu, 03 Feb 2011 13:53:44 +0100, spir wrote:
>>
>>> On 02/03/2011 01:17 PM, Lars T. Kyllingstad wrote:
>>>> Why the reluctance to use templa
On Tue, 08 Feb 2011 05:03:34 +, %u wrote:
> I've learned that an InputRange needs three methods to enumerate a
> collection:
>
> void popFront()
> @property T front()
> @property bool empty()
>
> but is that really necessary? Why not just have:
>
> bool next(out T value);
>
> ?
> W
On Wed, 09 Feb 2011 23:01:47 -0500, Andrej Mitrovic wrote:
> I'm trying to use the std.md5.sum method. It takes as an argument a
> digest to output the hash to, and the second argument is plain data.
>
> So I'm trying to read an entire file at once. I thought about using
> rawRead, but I get a ru
On Thu, 10 Feb 2011 04:29:21 -0500, canalpay wrote:
> I am trying to write the web framework(but not to write, to gain
> experience.). Maybe the framework can has got a MVC desing pattern. But
> first, the D2 is not has got for the web library and I am decided write
> to library for web.
>
> I a
On Thu, 10 Feb 2011 16:44:12 +0530, d coder wrote:
> Greetings All
>
> I have learnt that D has only one casting operator and that is 'cast'.
> The same operator assumes different functionality depending on the
> context in which it he being used.
>
> Now I have a situation where I have to downc
On Thu, 10 Feb 2011 11:54:02 +, Lars T. Kyllingstad wrote:
> On Thu, 10 Feb 2011 16:44:12 +0530, d coder wrote:
>
>> Greetings All
>>
>> I have learnt that D has only one casting operator and that is 'cast'.
>> The same operator assumes different func
On Tue, 15 Feb 2011 21:32:06 +0100, Jacob Carlborg wrote:
> Maybe a little off topic but does anyone know about a git library, I'll
> only need to do checkouts?
Here is a C library, written by the folks behind GitHub:
https://github.com/schacon/libgit
-Lars
On Fri, 18 Feb 2011 02:02:51 +, Sean Eskapp wrote:
> If I have
>
> class Bar(T)
> {
> }
>
> void foo(Y)()
> {
>...
> }
>
> Is there a way to check inside foo() that Y is in some way an
> instantiation of Bar? Is there a way to find WHICH instantiation it is?
void foo(Y)()
{
static
On Fri, 18 Feb 2011 16:38:19 +, Kai Meyer wrote:
> I can't seem to use std.datetime at all. I get undefined reference on
> whether I use a StopWatch, or if I just try to compile the unittest. All
> I have to do is declare a StopWatch:
>
> import std.stdio;
> import std.datetime;
>
> void mai
On Fri, 18 Feb 2011 17:16:02 +, Sean Eskapp wrote:
> I was given this code, to check if Y is a specialization of Bar. How
> does it work?
>
> class Bar(T)
> {
> }
>
> void foo(Y)()
> {
> static if (is(Y Z == Bar!Z))
> {
> // Here, Z is now an alias to whichever type Bar is //
On Fri, 18 Feb 2011 10:23:41 -0800, Jonathan M Davis wrote:
> On Friday, February 18, 2011 10:12:09 Kai Meyer wrote:
>> Great news! Worked like a champ. Is there documentation somewhere that
>> I missed? I would love to be able to answer these questions on my own.
>> I've been stumped on this one
On Fri, 18 Feb 2011 20:37:38 +, Sean Eskapp wrote:
> == Quote from Lars T. Kyllingstad (public@kyllingen.NOSPAMnet)'s article
>> On Fri, 18 Feb 2011 17:16:02 +, Sean Eskapp wrote:
>> > I was given this code, to check if Y is a specialization of Bar. How
>> &g
On Sun, 20 Feb 2011 15:23:29 -0500, Steven Schveighoffer wrote:
> On Sun, 20 Feb 2011 14:51:10 -0500, bearophile
> wrote:
>
>> Jacob Carlborg:
>>
>>> Every time I try to use D2 it's just a PITA to use. I've used D1 and
>>> Tango for
>>> several years and had no problem with that.
>>
>> I use thi
On Mon, 21 Feb 2011 12:18:54 +0100, Magnus Lie Hetland wrote:
> On 2011-02-20 19:22:20 +0100, Magnus Lie Hetland said:
>
>> On 2011-02-19 22:25:31 +0100, Nick Sabalausky said:
>>
>> [snip]
>>> Unfortunately, rdmd doesn't seem to have gotten much attention lately.
>>> I've had a few patches for i
The dmd help text says the following about the -nofloat switch:
-nofloat do not emit reference to floating point
What does this mean? What is -nofloat good for?
-Lars
On Thu, 24 Feb 2011 13:27:39 -0500, Trass3r wrote:
> Why doesn't this work:
>
> import std.stdio;
> void main()
> {
> float a,b=0;
> writefln("%x %x", a, b);
> }
>
> std.format.FormatError: std.format floating
That is because %x is for formatting integers. If you want a hex
repres
On Sun, 27 Feb 2011 15:52:01 +0100, simendsjo wrote:
> I'm having some problems grokking version.
>
> How would I translate this simple C macro? #if !defined(IDENT) ||
> !defined(IDENT2)
>
> I've tried the following:
> version(!IDENT)
> > identifier or integer expected, not !
>
> !version(IDEN
On Tue, 01 Mar 2011 12:25:30 +0100, Magnus Lie Hetland wrote:
> In Andrei's book, as well as in the Phobos source, there are property
> getters that return refs, as in...
>
> @property ref T front() {
> return _payload[0];
> }
>
> ... and code that uses this with simple assignments, su
On Wed, 02 Mar 2011 13:35:11 +0100, Magnus Lie Hetland wrote:
> First question: I just noticed that writefln("%a", 1.2) writes
> 0x1.3p+0, while writeln(format("%a", 1.2)) (that is, with
> std.string.format) writes 0x9.8p-3 ... wouldn't it be nice
> to be consistent here? (
On Sat, 05 Mar 2011 10:15:48 -0700, user wrote:
> On 03/04/2011 09:22 PM, Jonathan M Davis wrote:
>> On Friday 04 March 2011 20:14:32 Kai Meyer wrote:
>>> I have an 'enforce' function call in an 'in' block for a function.
>>> When I compile with "-release -O -inline", the in/out blocks appear to
>
On Sat, 05 Mar 2011 18:12:30 +, Lars T. Kyllingstad wrote:
> On Sat, 05 Mar 2011 10:15:48 -0700, user wrote:
>
>> On 03/04/2011 09:22 PM, Jonathan M Davis wrote:
>>> On Friday 04 March 2011 20:14:32 Kai Meyer wrote:
>>>> I have an 'enforce' fu
On Wed, 16 Mar 2011 11:20:43 +0100, spir wrote:
> On 03/16/2011 06:41 AM, Jesse Phillips wrote:
>> Ali Çehreli Wrote:
>>
>>> Right? Is there a better way that I am missing?
>>>
>>> Thank you,
>>> Ali
>>
>> No better way, the stated reason IIRC is that it is easier to remove
>> the new line then to
On Sat, 30 Apr 2011 00:09:09 -0400, Andrej Mitrovic wrote:
> import std.range;
>
> void main()
> {
> int[] a = [1, 2, 3];
>
> a.put(6);
> assert(a == [2, 3]);
>
> a.put([1, 2]);
> assert(a.length == 0);
> }
>
> Seems kind of odd.. put is implemented as an append met
On Mon, 09 May 2011 09:49:04 +0100, Russel Winder wrote:
> On Sun, 2011-05-08 at 23:52 -0700, Jonathan M Davis wrote: [ . . . ]
>> I could look at writing an article on moving from std.date to
>> std.datetime, I suppose. We already have an article contest going, and
>> it would make sense to put s
On Wed, 15 Jun 2011 23:57:25 +, Justin Whear wrote:
> Consider the following:
>
> You have 10 million data points and you need to apply a multipass
> algorithm to them. Each pass is like a cellular automata: it can read
> from the previous pass but it doesn't know the "current" values. This
>
On Thu, 16 Jun 2011 13:22:33 +, Lars T. Kyllingstad wrote:
> On Wed, 15 Jun 2011 23:57:25 +, Justin Whear wrote:
>
>> Any thoughts appreciated.
>
> I would recommend you take a look at the new std.parallelism module,
> which was introduced in the most rece
On Thu, 16 Jun 2011 06:52:45 -0400, Michel Fortin wrote:
> On 2011-06-15 23:29:46 -0400, Charles McAnany
> said:
>
>> Ah, so does the compiler figure out which ones are strongly and weakly
>> pure and then optimize as
>> appropriate? Is there a way to indicate that a function is strongly
>> pure
On Thu, 16 Jun 2011 17:38:27 +, Charles McAnany wrote:
> Ok, I think I get it. That cleared it up. =). So, if you have a
> functioned labelled pure, it's your job to not pass it mutable
> arguments, but the compiler's job to make sure it doesn't mutate
> anything not in the arguments. And that
On Mon, 27 Jun 2011 16:41:14 -0400, bearophile wrote:
> This question is related to this thread:
> http://d.puremagic.com/issues/show_bug.cgi?id=3632
>
> Can you tell me why real.nan and real.init don't contain the same bit
> patterns?
>
>
> import std.math: isIdentical;
> void main() {
> a
grauzone wrote:
Use
ubyte[] fontbytes = cast(ubyte[])import("yourfont.ttf");
That is so cool.
I've seen the import() expression mentioned here on the NG before. It
returns a string containing the imported source file, right? Is it
mentioned anywhere in the docs? I can't seem to find it.
-L
How can one, in D2, at compile time, convert an integer value (or any
other type, for that matter) to a string? Here's a simplified example of
what I want to do:
import std.conv;
template Say(int N)
{
pragma(msg, to!string(N));
}
mixin Say!(123);
This doesn't comp
bearophile wrote:
Lars T. Kyllingstad:
How can one, in D2, at compile time, convert an integer value (or any
other type, for that matter) to a string?
std.metastrings.ToString or std.metastrings.Format, but in D2 that Format is
buggy.
Bye,
bearophile
Thank you. ToString did the job
Can someone with knowledge of the DMD source code please explain this
error message for me?
dmd: glue.c:652: virtual void FuncDeclaration::toObjFile(int): Assertion
`!v->csym' failed.
I had a look at the DMD source to try and make some sense of it myself,
but didn't succeed. I am using the l
Don wrote:
Lars T. Kyllingstad wrote:
Can someone with knowledge of the DMD source code please explain this
error message for me?
dmd: glue.c:652: virtual void FuncDeclaration::toObjFile(int):
Assertion `!v->csym' failed.
I had a look at the DMD source to try and make some sen
Don wrote:
Lars T. Kyllingstad wrote:
Don wrote:
Lars T. Kyllingstad wrote:
Can someone with knowledge of the DMD source code please explain
this error message for me?
dmd: glue.c:652: virtual void FuncDeclaration::toObjFile(int):
Assertion `!v->csym' failed.
I had a look at
Nick Sabalausky wrote:
Before I go to post a bug report I want to make sure I'm not missing
something:
On http://www.digitalmars.com/d/1.0/struct.html it says that structs support
operator overloading. But I can't seem get opCmp to execute on a struct
without calling it explicitly:
Is there ever any reason to use float or double in calculations? I mean,
when does one *not* want maximum precision? Will code using float or
double run faster than code using real?
I understand they are needed for I/O and compatibility purposes, so I am
by no means suggesting they be removed
novice2 wrote:
I want to use Phobos
std.process.execv(in string pathname, in immutable(char)[][] argv)
to execute external programm with some parameter. But i found, that can't pass
parameter properly - they not passed.
Here very short example - caller.exe shoud call called.exe with parameters:
Don wrote:
Lars T. Kyllingstad wrote:
Is there ever any reason to use float or double in calculations? I
mean, when does one *not* want maximum precision? Will code using
float or double run faster than code using real?
I understand they are needed for I/O and compatibility purposes, so I
robby wrote:
can anybody help me translate this c function to d, im having a problem with
the data types. thanks.
//-
unsigned int BLZCC blz_pack(const void *source,
void *destination,
unsigned int length,
robby wrote:
thanks for help, i did the conversion as you mentioned and i get various errors
involving constant, lvalue, etc., just fyi, its part of code from brieflz (LZ77
variant) which ive been trying to port to D for use in my program.
Perhaps you could paste the error messages here? And
robby wrote:
i'm using D1/Tango. sorry, im not sure to how to explain the error messages, but if you need to look a t full code, here is the link
http://www.ibsensoftware.com/download.html
thanks again.
Several places in that code, I notice things like this:
const type foo;
...
Ary Borenszweig wrote:
Lars T. Kyllingstad escribió:
robby wrote:
i'm using D1/Tango. sorry, im not sure to how to explain the error
messages, but if you need to look a t full code, here is the link
http://www.ibsensoftware.com/download.html
thanks again.
Several places in that co
BCS wrote:
Hello Ary,
Well, it should work! const means, once a value is assigned to that
variable, it never changes again. The compiler can do static analysis
to verify this. And that's why it works. And that's why D should also
work this way, IMHO.
In D1, const is truly const, as in never
Jesse Phillips wrote:
I don't know if I'm misunderstanding the use of shell() or if this is a
bug. Trying to run some programs with shell error with a could not close
file. Sadly it I can come to any reasonable conclusion as to why.
Example output from running writeln(shell("gcc"))
gcc: no inp
Jesse Phillips wrote:
On Tue, 07 Jul 2009 12:04:43 +0200, Lars T. Kyllingstad wrote:
Jesse Phillips wrote:
I don't know if I'm misunderstanding the use of shell() or if this is a
bug. Trying to run some programs with shell error with a could not
close file. Sadly it I can c
Jesse Phillips wrote:
On Tue, 07 Jul 2009 12:04:43 +0200, Lars T. Kyllingstad wrote:
Jesse Phillips wrote:
I don't know if I'm misunderstanding the use of shell() or if this is a
bug. Trying to run some programs with shell error with a could not
close file. Sadly it I can c
D. Reeds wrote:
Robert Fraser Wrote:
D. Reeds wrote:
can anybody help me translate this c code into d, im using D1+tango combo. i'm new to D and got stucked on multi-dimension array part.
int levenshtein_distance(char *s,char*t)
//Compute levenshtein distance between s and t
{
//Step 1
i
D. Reeds wrote:
Lars T. Kyllingstad Wrote:
Fun fact: There is already a Levenshtein distance algorithm in Phobos
for D2:
http://www.digitalmars.com/d/2.0/phobos/std_algorithm#levenshteinDistance
I know you said you use D1+Tango, I just thought I should mention it.
The source code is
Sam Hu wrote:
Does D2 has the equivalent implemenation of exception no throw out of a method:
void myMethod() throw(){}
Or,D2 has its own/better implementation on such feature,if yes,what is that?
Thanks in advance.
Regards,
Sam
Yes, it's called nothrow. :)
nothrow void myMethod() { ... }
Haruki Shigemori wrote:
Hi.
The std.cstream.dout has a member function dout.flush.
But the std.stdio has not a function flush or a similar function.
Why? Don't you want to have it?
Give me the std.stdio.flush!
All the write functions in std.stdio (write, writeln, writef, writefln)
flush auto
Lars T. Kyllingstad wrote:
Haruki Shigemori wrote:
Hi.
The std.cstream.dout has a member function dout.flush.
But the std.stdio has not a function flush or a similar function.
Why? Don't you want to have it?
Give me the std.stdio.flush!
All the write functions in std.stdio (write, wr
Ary Borenszweig wrote:
Lars T. Kyllingstad wrote:
Lars T. Kyllingstad wrote:
Haruki Shigemori wrote:
Hi.
The std.cstream.dout has a member function dout.flush.
But the std.stdio has not a function flush or a similar function.
Why? Don't you want to have it?
Give me the std.stdio.
Sam Hu wrote:
Lars T. Kyllingstad Wrote:
Yes, it's called nothrow. :)
nothrow void myMethod() { ... }
-Lars
Thanks a lot.I have tried to search in section Expression,Statment,Classes
,Handling Errors of D2 spec but no found...
It's located under "Functions":
http:/
Don wrote:
Jarrett Billingsley wrote:
I don't think you can call struct methods at compile-time. Kind of
lame, I know. Try making norm a free function.
Can the D2 compiler modified/improved to allow this?
It sure would be nice.
In fact the D1 compiler should support it too.
BTW a few of
Here's a puzzle for you floating-point wizards out there. I have to
translate the following snippet of FORTRAN code to D:
REAL B,Q,T
C --
C |*** COMPUTE MACHINE BASE ***|
C --
T = 1.
10T = T + T
IF ( (1.+T)
Lars T. Kyllingstad wrote:
Here's a puzzle for you floating-point wizards out there. I have to
translate the following snippet of FORTRAN code to D:
REAL B,Q,T
C --
C |*** COMPUTE MACHINE BASE ***|
C --
T =
llltattoolll wrote:
hi im noob here and try learn D language, i try make this example but when run
have 2 problems.
1) when i show name and lastname show me in two lines and i wanna make in the
same line.
2) can´t validate option si ( yes ) or no ( no ) and always show the else line.
what hap
Lars T. Kyllingstad wrote:
llltattoolll wrote:
hi im noob here and try learn D language, i try make this example but
when run have 2 problems.
1) when i show name and lastname show me in two lines and i wanna make
in the same line.
2) can´t validate option si ( yes ) or no ( no ) and always
Ali Cehreli wrote:
The 'static' keyword is required by dmd 2.031 for the second of these two
definitions:
int[2] static_0 = [ 1, 1 ];
static int[2] static_1 = [ 1:1 ];
Is this inconsistency by design? Should 'static' be required for both or
neither?
Ali
I've tried with DMD 2.031, and
Ali Cehreli wrote:
Does the expression [ 0, 1, 2 ] form an immutable array? If so, is the
assignment to a[0] undefined below? Is it trying to modify an immutable element?
int[] a = [ 0, 1, 2 ];
a[0] = 42;
The reason for my thinking that [ 0, 1, 2] is an array is because it has the
.du
Saaa wrote:
Some time ago I requested something on .D, but it was ignored.
I'm interested in why this is so.
It was only a small request, maybe not fitting for .D but dsourse/phobos
said that was the place for such things.
(Maybe it was unintelligible again?)
The place (.D) was right, but I t
Ellery Newcomer wrote:
Why is function overloading not applied to nested functions?
Good question. Intuitively it seems to me that they should act just like
other functions. I couldn't find anything about it in the spec, but I
found this (on the "Functions" page):
Unlike module level d
Ali Cehreli wrote:
Lars T. Kyllingstad Wrote:
I've tried with DMD 2.031, and I can't reproduce this. This works fine
for me:
int[2] static_0 = [ 1, 1 ]:
int[2] static_1 = [ 1:1 ];
Where did you put the declarations? I've tried putting them at both
module level and
Saaa wrote:
"Lars T. Kyllingstad" wrote in message
news:h5tsuu$bc...@digitalmars.com...
Saaa wrote:
Some time ago I requested something on .D, but it was ignored.
I'm interested in why this is so.
It was only a small request, maybe not fitting for .D but dsourse/phobos
sa
Peter Alexander wrote:
Simen Kjaeraas Wrote:
Macros are currently scheduled for D3. In the meantime, you can do just
about anything with string mixins and CTFE.
Cool. Is there any sort of ETA on D3?
Man, we just got the ETA on D2... :)
-Lars
Peter Alexander wrote:
Hey all,
I'm considering learning D at the moment, and one thing that has bothered me in
C++ is the lack of partial template function specializations. For example, you
can create something like this:
template
const Field norm(const V& v);
and you can specialize it:
t
Lars T. Kyllingstad wrote:
First of all, I don't know how it is in C++, but in D you rarely write
function declarations without definitions.
What I meant was: I don't know how common *templated* function
declarations are. I know C++ programmers tend to put the declaration in
one
Don wrote:
Lars T. Kyllingstad wrote:
Don wrote:
Jarrett Billingsley wrote:
I don't think you can call struct methods at compile-time. Kind of
lame, I know. Try making norm a free function.
Can the D2 compiler modified/improved to allow this?
It sure would be nice.
In fact t
JPF wrote:
I've hit a strange problem somewhere in my code and I narowed it down to
the following testcase:
--
module test;
import tango.io.Stdout;
const ulong SIZE_IN_B = (1024 * 1024 * 1024 * 2); /*should be 2147483648*/
void main()
{
Stdout.formatln("{0}", SIZE_IN_
Tom S wrote:
Max Samukha wrote:
Tom S wrote:
And/or compile some modules without -g. Maybe you don't need debug
symbols everywhere.
And please vote for
http://d.puremagic.com/issues/votes.cgi?action=show_bug&bug_id=424.
Something makes Walter think this bug is not critical.
I think he k
#ponce wrote:
Stewart Gordon Wrote:
My recollection of reading the spec is that a D compiler is allowed to
optimise by assuming no pointer aliasing. But I can't remember at the
moment where I read this.
I don't know if this is neat or nasty for a compiler to do so.
OT : Is there a DMD swi
bearophile wrote:
Sam Hu Wrote:
It seems the error is not located in the code you have shown:
http://codepad.org/ti7SaAtA
So I think you have to show more code.
Try to create a reduced case that shows the same error.
You won't necessarily be able to reproduce the error with codepad.org
anyw
Michal Minich wrote:
Hello rmcguire,
why is this not a compiler bug?
because:
import std.stdio;
void main() {
float f=0.01;
writefln("%0.2f->%d",f,cast(int)(f*100f));
writefln("%0.2f->%d",f,cast(int)(.01*100f));
writefln("%0.2f->%f",f,(f*100f));
}
results in:
0.01->0
0.01->1
0.01->1.00
I wo
Charles Hixson wrote:
Lars T. Kyllingstad wrote:
Michal Minich wrote:
Hello rmcguire,
why is this not a compiler bug?
because:
import std.stdio;
void main() {
float f=0.01;
writefln("%0.2f->%d",f,cast(int)(f*100f));
writefln("%0.2f->%d",f,cast(int)(.01*100f));
writ
torhu wrote:
On 11.11.2009 04:57, Sean Fennell wrote:
I'm very green to D, just learning it now.
I have a module that I wrote. Its pretty simple, just helper
functions to get input from user as certain data types
GetInt()
GetString()
GetChar()
etc...
I compiled the module using dmd -lib mymo
Gzp wrote:
void foo(T)(ref T t) if (isPrime!(T)) { ... }
void foo(T)(ref T t) if (!isPrime!(T)) { ... }
What is the difference b/n
void foo(T)(ref T t) if (isPrime!(T)) { ... }
and
void foo(T)(ref T t) static if (isPrime!(T)) { ... }
as both of them seems to be a compile time check for me.
Don wrote:
bearophile wrote:
Bill Baxter:
The good thing is that since most of the machinery is there, the
actual compiler changes required would mostly be just rewrites of new
syntax in terms of existing functionality.
I agree, this looks like something that can be added to D even after
D2
Nick Sabalausky wrote:
Is there an idiom, preferably D1, to detect whether or not the code is
currently executing as a ctfe?
Ie:
void foo()
{
(static?) if( )
{
// Run-time code here
// that does stuff the CTFE engine chokes on
}
else
{
// CTFE c
downs wrote:
Alex wrote:
Is it possible, using templates, tuples, or some other mechanism, to implement
named variadic arguments in D?
For example, I'd like to be able to do something like...
foo( 2, &bar, age : 10, status : "down");
and so forth.
Yes, with a small hack.
typedef int age_ty
Lars T. Kyllingstad wrote:
downs wrote:
Alex wrote:
Is it possible, using templates, tuples, or some other mechanism, to
implement named variadic arguments in D?
For example, I'd like to be able to do something like...
foo( 2, &bar, age : 10, status : "down");
and so f
strtr wrote:
Stanislav Blinov Wrote:
Pelle M幩sson wrote:
I'm in need for a timer library that measures the acutal time. I have
tried std.c.time's clock(), but it only measures time spent inside the
program, not actual time elapsed.
I need at least millisecond resolution, so std.c.time.time(
Ali Çehreli wrote:
Do I understand module level access rights correctly, or is there a dmd
bug?
Instead of coming up with an example, I will use a Phobos class:
std.demangle.MangleException is private in its module; yet I can use it
in my program:
import std.demangle;
void main()
{
aut
strtr wrote:
BCS Wrote:
Hello Strtr,
If you can try it on linux it's not to hard to build a debug version of dmd
and run it under the debugger. That will at least give you a filename/line
number for the bug report and with a little thinking and a stack trace you
can take a guess at what co
Robert Clipsham wrote:
On 15/02/10 21:44, Jesse Phillips wrote:
Robert Clipsham wrote:
I've been wanting to try D2 properly for a while now, but as I use linux
x86-64 I've had to resort to using a virtual machine, which is really
off putting when I just want to play around with it. I've read m
Robert Clipsham wrote:
I've been wanting to try D2 properly for a while now, but as I use linux
x86-64 I've had to resort to using a virtual machine, which is really
off putting when I just want to play around with it. I've read multiple
threads about getting dmd working with a multilib system,
Jonathan M Davis wrote:
Okay, I'm looking to be able to run an external program from within my D
program. The library functions for this appear to be in std.process. You
have system() and various versions of execv(). system() makes a call in
shell. execv() executes the program without a shell.
Nils Hensel wrote:
Daniel Keep schrieb:
If you look at the real main function in src\phobos\internal\dmain2.d,
you'll see this somewhere around line 109 (I'm using 1.051, but it's
unlikely to be much different in an earlier version):
for (size_t i = 0; i < argc; i++)
{
auto len = strlen(ar
Lars T. Kyllingstad wrote:
Nils Hensel wrote:
Daniel Keep schrieb:
If you look at the real main function in src\phobos\internal\dmain2.d,
you'll see this somewhere around line 109 (I'm using 1.051, but it's
unlikely to be much different in an earlier version):
for (size_t i =
Daniel Keep wrote:
...
I see that neither the constructor nor the postblit is called.
Apparently the bit representation is used. This has the risk of
violating struct invariants.
Is it legal?
Thank you,
Ali
cast is to value conversions what a tactical nuclear strike is to
peaceful negotiatio
Robert Clipsham wrote:
Hi all,
I'm playing with D2/Phobos, and was wondering what the right way to
convert between const char* and string is? In D1/Tango I could use
toStringz() and fromStringz() from tango.stdc.stringz, I can only find
an equivalent for toStringz in D2/Phobos though, in std.
Jonathan M Davis wrote:
std.algorithm.find() returns the rest of the range starting at what you were
searching for (or an empty range if it wasn't in the given range). Is there
a function in phobos which does a find but returns everything _before_ what
you're searching for?
I can't find one
Jonathan M Davis wrote:
Lars T. Kyllingstad wrote:
Jonathan M Davis wrote:
std.algorithm.find() returns the rest of the range starting at what you
were searching for (or an empty range if it wasn't in the given range).
Is there a function in phobos which does a find but returns every
Ludovic A. wrote:
I am trying to write a simple file parser in D2. Following examples I found 2
working ways to read a line and print it:
Where did you find the examples? They seem pretty out-of-date.
import std.stream
(...)
Stream file = new BufferedFile(filename);
foreach(char[] line
Ludovic A. wrote:
Hej,
thanks! First I want to underline that I use Digital Mars D Compiler v2.040, and
my 2 examples are _working_ examples with this compiler. So I really mean that
std.file is working on the last D compiler :)
I felt that those examples didn't 'smell' like D, and I also got s
Ali Çehreli wrote:
Lars T. Kyllingstad wrote:
> What you're seeing here is actually a consequence of Phobos very much
> being a work-in-progress. std.stdio was completely rewritten about a
> year ago, and it most likely contains what you're looking for.
>
> std.
101 - 200 of 222 matches
Mail list logo