Hello Jonathan,
On Sunday 14 November 2010 03:45:12 spir wrote:
Hello,
Is there a way to check the runtime type of an element? Meaning, for
instance, process differently according to the actual type in a
hierarchy?
class C {}
class C1 : C {int i;}
bool checkTypeC1 (C c) {
return
Hello bearophile,
In a not-ranged cases body, like in the program below (that doesn't
compile), the switch variable is a compile-time constant, so why
doesn't the compile see x as constant there?
template Foo(uint x) {
static if (x = 1)
enum Foo = 1;
else
enum Foo = x * Foo!(x - 1);
}
int
Benjamin Thaut c...@benjamin-thaut.de wrote:
I recently read the book the D programming language and wanted to try
out a few of the multithreaded examples pointed out in this book. I
tried to write a version of the bank account example using the atomicOp
from core.atomic. But when I compile
Hello Benjamin,
Am 08.10.2010 11:13, schrieb Lars T. Kyllingstad:
On Fri, 08 Oct 2010 09:33:22 +0200, Benjamin Thaut wrote:
Hi, I'm writing a vec4 math struct and I have a method of which the
return value has to be a lvalue so I wonder which is the correct way
to do this:
vec4 Normalize()
GAH I HATE MAKE!!
Has anyone built libphobse.a and friends with a dmd other than the default?
I can use DMD=/path/to/dmd in the first level make and I can do the same
plus what the make file adds for the recursive call but when I start needing
to do it yet again for the call into
Hello Jacob,
On 2010-09-26 03:43, BCS wrote:
Hello Jacob,
On 2010-09-25 03:08, BCS wrote:
I've found the phobos source:
http://www.dsource.org/projects/phobos/browser/trunk/phobos
The DMD source:
http://www.dsource.org/projects/dmd/browser/trunk/
and this seems to be the runtime
Hello Jacob,
On 2010-09-25 03:08, BCS wrote:
I've found the phobos source:
http://www.dsource.org/projects/phobos/browser/trunk/phobos
The DMD source:
http://www.dsource.org/projects/dmd/browser/trunk/
and this seems to be the runtime:
http://www.dsource.org/projects/druntime/browser
I've found the phobos source:
http://www.dsource.org/projects/phobos/browser/trunk/phobos
The DMD source:
http://www.dsource.org/projects/dmd/browser/trunk/
and this seems to be the runtime:
http://www.dsource.org/projects/druntime/browser/trunk/
But I can't seem to even find object.d or
Hello Steven,
// note you can't use void as a parameter type in D
void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(/*void*/);
pragma(msg, typeof(xDlSym).stringof);
outputs:
void function() function(sqlite3_vfs*, void*, const const(char*)
zSymbol)
D, now with C type un-garbleing!
Hello Steven,
On Thu, 16 Sep 2010 10:06:24 -0400, BCS n...@anon.com wrote:
Hello Steven,
// note you can't use void as a parameter type in D
void (*(*xDlSym)(sqlite3_vfs*,void*, const char
*zSymbol))(/*void*/);
pragma(msg, typeof(xDlSym).stringof);
outputs:
void function() function
Hello Andrej,
Here's a little snippet of code that interfaces with Scintilla (it
works btw.):
File file = File(test.txt, r);
foreach (ubyte[] buf; file.byChunk(4096))
{
sendEditor(SCI_ADDTEXT, buf.length, (cast(char[])buf).idup);
}
The cast looks ugly, but I *have* to send a copy.
What do
Hello Andrej,
Yeah but using -of creates an executable in the directory I provide.
RDMD is supossed to be used with hiding the executable in a temp dir,
afaik.
So it's hashing at play, ok. Just wanted to know why.
Personally I'd like RDMD to hide the map and deps files as well, I
don't know
Hello Yao G.,
I'm here with another n00b question:
When dealing with big buffers (or files), which is better to use as
storage? void[] or byte[]?
If the data may contain pointers into the heap, use void[] if it will not
use byte[]. byte[] is raw data, void[] is anything at all.
What
Hello Ivo,
class C(T, U : A!(T)) { ... }
And I'm trying to do this
void main()
{
C!(double, B!(double)) var;
}
but dmd complains:
Error: template instance C!(double,B) does not match template
declaration C(T,U : A!(T))
The way you have it is asking for an exact match. I would have to look
Hello Jonathan,
On Monday 09 August 2010 21:18:42 BCS wrote:
We have pure functions, member functions, static functions and global
functions; but what kind of function can always be used with CTFE?
Haven't we typical called them CTFE or CTFEable functions?
I've seen the first used, even
Hello Steven,
On Sun, 08 Aug 2010 17:56:25 -0400, simendsjo
simen.end...@pandavre.com wrote:
I'm totally new to the const/immutable thing, so this might be a
naive question..
The spec says:
modification after casting away const = undefined behavior
I thought it was you're on your own, not
Hello Steven,
On Mon, 09 Aug 2010 10:11:39 -0400, Don nos...@nospam.com wrote:
Steven Schveighoffer wrote:
On Sun, 08 Aug 2010 17:56:25 -0400, simendsjo
simen.end...@pandavre.com wrote:
I'm totally new to the const/immutable thing, so this might be a
naive question..
The spec says:
Hello Steven,
On Mon, 09 Aug 2010 09:57:47 -0400, bearophile
bearophileh...@lycos.com wrote:
Steven Schveighoffer:
I thought it was you're on your own, not undefined behavior. The
former
implies there is some right way to do this if you know more about
the
data than the compiler, the
Hello Steven,
On Mon, 09 Aug 2010 10:37:14 -0400, BCS n...@anon.com wrote:
Hello Steven,
On Mon, 09 Aug 2010 10:11:39 -0400, Don nos...@nospam.com wrote:
Steven Schveighoffer wrote:
On Sun, 08 Aug 2010 17:56:25 -0400, simendsjo
simen.end...@pandavre.com wrote:
I'm totally new
Hello Steven,
On Mon, 09 Aug 2010 10:24:56 -0400, BCS n...@anon.com wrote:
Hello Steven,
On Sun, 08 Aug 2010 17:56:25 -0400, simendsjo
simen.end...@pandavre.com wrote:
I'm totally new to the const/immutable thing, so this might be a
naive question..
The spec says:
modification after
Hello Steven,
On Mon, 09 Aug 2010 10:53:48 -0400, BCS n...@anon.com wrote:
C's api can be modified at declaration. It has no mangling, so you
can type it how it should be (if C had const). For example:
extern(C) int strlen(const(char)* str);
I find that much more pleasant than having
We have pure functions, member functions, static functions and global functions;
but what kind of function can always be used with CTFE?
--
... IXOYE
Hello BCS,
We have pure functions, member functions, static functions and global
functions; but what kind of function can always be used with CTFE?
Compile Time Evaluable Function = CTEF? (sounds like CDEF; so testing many
minor variant of one you get AB CTEF testing :b
Hello simendsjo,
The spec is very short here, and the example doesn't give me much..
// I thought allows functinos to return by reference meant it could
return local variables..
ref int* ptr() {
auto p = new int;
*p = 12;
return p; // Error: escaping local variable
}
// So whats the difference
Hello simendsjo,
I'm totally new to the const/immutable thing, so this might be a naive
question..
The spec says:
modification after casting away const = undefined behavior
// ptr to const int
const(int)* p;
int* q = cast(int*)p;
*q = 3; // undefined behavior
But why would you want to cast
Hello Simen,
simendsjo simen.end...@pandavre.com wrote:
Ok, thanks. Does this mean this equivalent then?
int[] a = [1,2,3];
int[] b = a[0..1];
assert(a !is b);
assert(a.ptr == b.ptr a.length == b.length);
Well, no.
both asserts will fail (a.length == 3 != b.length == 1)
But what you
Hello simendsjo,
The spec for array says:
Static arrays are value types. Unlike in C and D version 1, static
arrays are passed to functions by value. Static arrays can also be
returned by functions.
I don't get the static arrays are passed to functions by value part.
Here I am passing in a
Hello Kagamin,
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmar
s.Darticle_id=114518
Is there a way to report a custom error message for unsupported
template instantiations?
template Foo(T)
{
static assert(Chcek!(T), message);
...
}
template Bar(T) if (is( T ==
Hello bearophile,
Philippe Sigaud:
Would a template-based solution be OK?
import std.stdio, std.traits;
CommonType!T[T.length] staticArray(T...)(T vals)
if ((T.length 0) is(CommonType!T))
{
return [vals];
}
That's one solution, but code like that is most useful when your
arrays liters
Hello Deokjae,
Hi there, I have some questions on the following code.
import std.stdio;
struct S {
int x;
}
void main() {
int[3] a = new int[3];//A
S* b = new S();//B
delete b;//C
}
What's the meaning of the line A?
Is the array allocated on heap? or stack?
IITC new give you something on
Hello Don,
Ellery Newcomer wrote:
On 07/21/2010 09:09 PM, strtr wrote:
Could somebody please explain this error to me.
evidently ctfe can't eat
foreach(i, dchar d; s){
}
Bleach. Make sure it's in bugzilla.
CTFE currently doesn't work on *any* functions which are implemented
in
Hello Mario,
Unless JSON requiers that the keys be in some order,
No, JSON does not require the names of an object to be in alphabetical
order.
the correct solution is to make the check order independent. For
example:
string s = CallReturningJSON();
s = replace(s,`a:23.54`, `X`);
s =
Hello Mario,
But then, JSON has a jew more unspecified gaps like whitespace can be
inserted between any pair of tokens.
That can be dealt with by just being consistent.
Shall we rely on the fact that the implementation currently does not
insert whitespace between tokens?
On the output
Hello Mario,
That is, shall we produce canonical JSON text at the price of
efficiency.
Or, shall the perfect implementation of JSON objects as associative
arrays be dropped?
Or, what else?
Unless JSON requiers that the keys be in some order, the correct solution
is to make the check
Hello j,
hi,
can anybody tell me please why the linker keeps bringing up this error
message? i am using the latest dmd 2.
thank you
OPTLINK (R) for Win32 Release 8.00.2
Copyright (C) Digital Mars 1989-2009 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
Hello dcoder,
Hello.
I'm wondering why in D if you declare a fixed multi dimensional array,
you have to reverse the index order to access an element.
When declaring an array, the base type is getting wrapped. When using an
array, the base types get unwrapped.
Because both forms place the
Hello div0,
The rule of thumb is don't bother spawning more threads than you have
cpus. You're just wasting resources mostly.
You REALLY don't want more threads trying to run than you have cores. Threads
in a wait state, are less of an issue, but they still use up resources.
--
... IXOYE
Hello div0,
On 11/07/2010 20:00, BCS wrote:
Hello div0,
The rule of thumb is don't bother spawning more threads than you
have cpus. You're just wasting resources mostly.
You REALLY don't want more threads trying to run than you have cores.
Threads in a wait state, are less of an issue
Hello div0,
On 11/07/2010 21:43, BCS wrote:
In what way?
Sometimes it just makes your program design easier if you fork a
process / spawn a thread; than trying to manage a thread pool and
allocating work to a fixed number of threads. Programmer time is more
expensive than cpu time
Hello Tim,
I think I understand the difference between const and immuable when
considering references and pointers, but how exactly is const
different from immutable in:
[...]
const(int) somefunc(); versus immutable(int) somefunc();
BTW both of those are pointless. The following works:
Hello Mike,
I'm trying to compile the following file. Can somebody explain to me
how I can rewrite it so that I don't get Error: non-constant
expression? All I'm trying to do is create, using templates, a string
of all characters between two given characters:
1) where did you get that error?
Hello bearophile,
Is alloca() pure?
Given the same input alloca() generally returns different pointers, so
it's not a pure function.
But the same is true for the ptr field when you allocate an array on
the heap.
And the memory allocated by alloca() never escapes the function, so it
looks
Hello Simen,
BCS n...@anon.com wrote:
You can resolve this by having a a.di file with the extern foo(); in
it (DMD has a flag to generate such a file for you). OTOH without
knowing what you are doing, I can't tell if this is the correct
solution.
I'm trying to create a framework
Hello Jacob,
On 2010-06-28 02:28, BCS wrote:
One solution would be to have templates strip off const/immutable
from the top level of args.
[...]
This solution would match the proposal that popped up a while ago to
allow value assignment from const/immutable to mutable.
I don't think I
Hello Rory,
On Sun, 27 Jun 2010 17:17:25 +0200, Philippe Sigaud
philippe.sig...@gmail.com wrote:
void main()
{
auto fun(string s) { return s;} // this does not compile
}
Hope this isn't a stupid question, but how would you access this
function
if it did work?
Would it be fun(asdf)?
Is this
Hello Simen,
module a;
extern void foo( );
void bar( ) {
foo( );
}
module b;
import std.stdio;
void foo( ) {
writeln( Hi! );
}
The above does not work (Error 42: Symbol Undefined _D1a3fooFZv).
Adding extern to foo in module b
Hello Mike,
I want to do the following:
foreach(obj; list)
{
if(obj.pleaseKillMe)
somehow_remove_the_object_from_the_list();
}
That isn't legal for normal arrays or AAs. IIRC the docs even say that you
can't change what a foreach is iterating over during the foreach. I think
you will have
Hello Jonathan,
For example, there are two functions that I'd like to be have: all()
and any(). That is, I want a function which checks a predicate against
a range and returns whether all elements in that range satisfy the
predicate, and I want a function that checks a predicate against a
range
Hello Jacob,
That's annoying, specially since char is a value type. I would
preferably have a solution for both D1 and D2. Can I use a template to
cast/alias away the immutable part?
One solution would be to have templates strip off const/immutable from the
top level of args.
void F1(T)(T
Hello Trass3r,
import std.stdio;
void main()
{
scope(exit) writeln(res);
auto res = 0;
}
This compiles, but using failure or success in the scope guard
statement
gives undefined identifier res.
Is this intended? If yes, why?
I'm going to guess that the given case is an accepts-invalid bug
Hello Graham,
On Fri, 11 Jun 2010 19:09:04 +, Philippe Sigaud wrote:
OK, this is a real newbie question:
How can I use std.process?
when I do:
import std.process;
void main() {
execvp(mkdir, [test]);
}
nothing happens.
What am I doing wrong?
I'm on Vista there, didn't try the
Hello Duke,
On Sun, 30 May 2010, Philippe Sigaud wrote:
On Sun, May 30, 2010 at 08:54, Simen kjaeraas
simen.kja...@gmail.comwrote:
Duke Normandin dukeofp...@ml1.net wrote:
[sidebar]
Why is every D tutorial I've touched upon so far, been frigged up?
This is NOT good advocacy, people! Bad
Hello bearophile,
struct Foo(T) {
this(T x) {}
void opCall(U)(U y) {}
}
void main() {
auto foo = Foo!int(1);
foo(1.5);
}
FWIW, The struct being a template is extraneous.
temp.d(7): Error: constructor temp.Foo!(int).Foo.this (int x) is not callable
using argument types (double)
The lookup
Hello Duke,
char[] password = sesame;
IIRC you are using D2 and that only work for D1, for D2 I think you need
to do:
string password = sesame;
This has something to do with the const system. I do know there is no way
to safely modify a char[] set from a string literal so D2 forcing you
Hello Pavel,
I create win32 application. (use dmd 2.046)
Exist object Thread in std.thread. Object Thread gives support for
garbage
collector, but I want to use
the function CreateThread.
Can I create threads with this function?
You can call it (you can call any C function). It should give
Hello Don,
Philippe Sigaud wrote:
On Thu, May 27, 2010 at 01:00, Simen kjaeraas
simen.kja...@gmail.com
mailto:simen.kja...@gmail.com wrote:
Here's a collection of templates I have created and use often. Some
of these may be fit for inclusion in Phobos, others maybe not as
much.
Please
Hello Simen,
Duke Normandin dukeofp...@ml1.net wrote:
So these two paragraphs in the tutorial are flat out wrong?
Absolutely.
Any idea who owns it so it can get changed? For that matter, who added the
link?
Being paranoid for the moment (it can be fun sometimes :) that blurb is so
Hello Don,
The most glaring limitation of the FP optimiser is that it seems to
never keep values in the FP stack. So that it will often do:
FSTP x
FLD x
instead of FST x
Fixing this would probably give a speedup of ~20% on almost all FP
code, and would unlock the path to further optimisation.
Hello Steven,
No. I meant bool = bool. I'm not comparing two bools, I'm assigning
to a bool, and then using if on the result. At best, this is a bogus
error message.
More often than not (or so the thinking goes), that isn't the case and the
programmer in fact did want ==.
Also, you
Hello Ellery,
as long as you don't
need any static constructors or destructors in either a or b.
It's a side issue but: static constructors + cyclic imports == pain
--
... IXOYE
Hello Joseph,
I can also see the desire to have a backend
that is fully under the control of the main developers.
There is also the point that if Walter never looks at the source for another
compiler, it is nearly impossible for him to be sued for stealing from them.
--
... IXOYE
Hello Justin Spahr-Summers,
On Mon, 19 Apr 2010 00:12:28 + (UTC), Graham Fawcett
fawc...@uwindsor.ca wrote:
Hi folks,
I'd like to wrap a family of C functions that look like this:
gboolean fooXXX(arg1, ..., argN, GError** err)
Their signatures and arities vary, but they all have a
Hello Philippe,
Of course, it'd be nice to check the EL at CT to see if they
correspond to func parameters types.
The call inside check will coever that for you as long as you don't mind
getting the error in an odd place.
--
... IXOYE
Hello Joseph,
To be sure I understand -- is there anything wrong with writing
scope auto f = new Foo(i)
BTW, the following might work:
scope f = new Foo(i);
--
... IXOYE
Hello bearophile,
writefln(%.5f\n, tot); // 17744.06000
Never trust your output function :) (e.i. always check to see if it's doing
what you think it is.)
Back in the bad old days, a guy I knew spent a while debugging a problem
that turned out to be that he was loading data as float but
Hello Justin Spahr-Summers,
On Mon, 5 Apr 2010 15:47:10 + (UTC), BCS n...@anon.com wrote:
I dind't know it worked?
It seemed to when I tested the snippet that I sent, but it might've
just been luck of the draw, and in reality fail silently on certain
edge cases. I'm really not sure
Hello Simen,
On Tue, 23 Mar 2010 08:35:54 +0100, Zólyomi Istvan
istvan.zoly...@gmail.com wrote:
Hi,
recently I've been experimenting with metaprogramming in D. I've been
trying to create a simple compiler benchmark that can be used like
the following oversimplified code:
const time
Hello Nick,
Is overloading across modules not allowed? Is overloading on two
different enum types not allowed? Is it a DMD bug? Or does this all
work fine and I probably just have some other problem elsewhere?
IIRC, this is done so that importing a module will never alter what function
a
Hello Philippe,
OK, I know opDispatch just appeared in DMD, but I remember a *huge*
thread on it, where people were jumping up and down waiting for it.
Me, I have no wonderful idea, though I feel some potential in it. The
only interesting use I found for now is making a class/struct
Using D2, I have a template class that looks something like this:
class C(T) { T t; }
(For simplicity, assume T is required to be a struct of some kind.) I want
to have a constructor that passes on some of it's args to a constructor for
t. This is easy as long as I don't need it to work for
Hello Lutger,
Workaround if T has a single constructor, perhaps it can be
generalized with some work:
this(int foo, float bar, std.traits.ParameterTypeTuple!(T.__ctor)
args)
{
t = T(args);
}
Not exactly ideal, but... :)
--
... IXOYE
Hello Steven,
What about a static function instead of a constructor?
i.e.
static C create(Args...)(int foo, float bar, Args args)
{
auto c = new C(foo, bar);
c.t = T(args);
return c;
}
That's my fallback position.
It's a shame template constructors aren't allowed, they aren't even
virtual
Hello Kris,
Hi folks,
Is it possible to split the files up to use one class per file again,
but add a red.xml.xmldom module imports and exposes them somehow?
Take a look at the details of import. IIRC public import does something
like what you want.
I was hoping it'd be something like
Hello Strtr,
Would you ever have an alignment hole if all the struct contains are
basic types(excluding bool)?
real, char[n], byte[n] and short[m] (for n%4 != 0 and m%2 != 0) might be
an issue.
--
... IXOYE
Hello Strtr,
BCS Wrote:
Hello Strtr,
Would you ever have an alignment hole if all the struct contains are
basic types(excluding bool)?
real, char[n], byte[n] and short[m] (for n%4 != 0 and m%2 != 0) might
be an issue.
Sounds logical, thanks!
I don't actually *know* those
Hello Strtr,
Suppose I'd still would like to use void optimizations, how do you
clear the holes manually?
IIRC zero filling a block is likely cheaper that zero filling holes in it.
I'd avoid =void unless you know you will be copying structs into the space
(that will copy the holes as
Hello grauzone,
BCS wrote:
I need a function that works like the following:
T* New(T)() { return new T; }
But that also works with static arrays:
auto i = New!(int)();
auto a = New!(int[27])();
The cleanest solution I can think of is:
T* New(T)() { return (new T[1]).ptr
Hello FeepingCreature,
I assumed that was what you wanted.
Well my bad.
Maybe you should just special-case static arrays inside the function
with static if.
It's still ugly but it's what I'm going with for now.
--
... IXOYE
Hello FeepingCreature,
On 24.02.2010 05:16, BCS wrote:
I need a function that works like the following:
T* New(T)() { return new T; }
But that also works with static arrays:
auto i = New!(int)();
auto a = New!(int[27])();
The cleanest solution I can think of is:
T* New(T)() { return
Hello Daoryn,
BCS Wrote:
I need a function that works like the following:
T* New(T)() { return new T; }
But that also works with static arrays:
auto i = New!(int)();
auto a = New!(int[27])();
The cleanest solution I can think of is:
T* New(T)() { return (new T[1]).ptr
Hello GG,
Thanks you very much for your explanation ! I got it work with gdb and
got this:
[...]
I don't know enough about the internals to be able to help you beyond maybe
converting the seg-v into an assert (but you should be able to do that yourself).
Someone else might be able to do
Hello Brad,
The other thing you could try is to take dmd out of the loop. Can you
build a 32 bit c/c++ app with gcc/g++ directly? If you can't get that
to work, it's unlikely that dmd will we successful either, given that
it relies on gcc to invoke the linker, picking up all the right c
Hello GG,
Hello !
I have already used gdb to debug program compiled with dmd, but never
link gdb with DMD at same time.
I found on google something like this : nameofprogram -g -d gdb
But when I try with DMD like : DMD -g -d gdb [...] , the compiler DMD
look for a .d file (cannot read file
Hello Funog,
Is it possible to run an external .exe and have access to its standard
input/output? Apparently std.process does not allow this.
I think there is a pstream or PipeStream somewhere but I don't remember where
I saw that.
--
... IXOYE
Hello Strtr,
dmd(1.048/55/56) crashed on me:
AppName: dmd.exe AppVer: 0.0.0.0 ModName: unknown
ModVer: 0.0.0.0 Offset: 0002
There is a lot of crash data but I do not know where to start looking.
I've also tried finding which part of the code is responsible, but I
haven't
Hello Strtr,
-v ended like this :
semantic Cg_shader
semantic abgr
semantic bgra
seman
This is code within Derelict I think.
Strange sudden break..
Stopping mid word makes me think that the output buffer didn't get flushed
so something failed after the next to last line, but you don't
Hello Nick,
Pelle Månsson pelle.mans...@gmail.com wrote in message
news:hjmmod$1io...@digitalmars.com...
I think in should work for keys in an associative array and for
values in a regular array.
This is how it works in python.
Aside from that being how Python does it, why do you see that
Hello Jesse,
For the following code I get the bellow error. I'm wondering if I
should be reporting a bug, or if creating default delegates is
correctly prevented?
.\defltdg.d(10): Error: delegate defltdg.__dgliteral3 is a nested
function and cannot be accessed from main
import std.stdio;
Hello Michal,
if one has double indexed aa, how to find that it contains value under
keys 'a' and 123
float[int][char] aa;
aa['a'][123] = 4.56;
I had to make following helper function. Is there more elegant way /
built in into D?
float* isIn = doubleIn(123, 'a');
float* doubleIn (int i,
Hello sybrandy,
Hello,
I've been writing a bit of compression code and I noticed some strange
behavior that's driving me a bit batty. I don't know if it's a bug
with D or something I did. All I know is I can't figure it out.
Below is the simplified version of the code as a single file. It
Hello Strt,
Lutger Wrote:
On 01/03/2010 04:31 AM, Strt wrote:
How can I generate some sort of call diagram from my D code?
you can compile with (dmd) -profile and run the executable. This
produces a file called trace.log which contains timings for each
function and a call graph. It
Hello grauzone,
bearophile wrote:
In other benchmarks memory usage of Free Pascal is not dramatically
lower, but it's usually near the top of lower memory usage in all
Shootout benchmarks.
No idea. I just know that FPC doesn't use GCC. I think it doesn't even
link to libc! (I can't really
Hello Ary,
Don wrote:
BCS wrote:
Hello Ary,
Don wrote:
Phil Deets wrote:
On Mon, 28 Dec 2009 16:18:46 -0500, Simen kjaeraas
simen.kja...@gmail.com wrote:
Apart from C legacy, is there a reason to assume anything we
don't
know what
is, is an int? Shouldn't the compiler instead say
Hello teo,
There was a way to define new types within templates and I think that
I have seen that demonstrated here in the newsgroups, but cannot find
it now. Can someone help me please?
I would like to do something like this:
template MyTemplate(T)
{
struct T ~ Struct // define FooStruct
Hello Don,
Simen kjaeraas wrote:
Apart from C legacy, is there a reason to assume anything we don't
know
what
is, is an int? Shouldn't the compiler instead say 'unknown type' or
something
else that makes sense?
There's now an Error type in the compiler. It's gradually filtering
its way
Hello Ary,
Don wrote:
Phil Deets wrote:
On Mon, 28 Dec 2009 16:18:46 -0500, Simen kjaeraas
simen.kja...@gmail.com wrote:
Apart from C legacy, is there a reason to assume anything we don't
know what
is, is an int? Shouldn't the compiler instead say 'unknown type' or
something
else that
Hello Steven,
From my very hazy memory, I think there can even be multiple binary
representations of nan, but I'm not sure.
-Steve
yes, IIRC NaNs can have a few bits of payload as well as there being signaling
and non-signaling NaNs.
Hello bearophile,
Do you know what's causing the difference in the outouts?
void main() {
double d1 = 3.14159;
printf(%a\n, d1);
writefln(%a\n, d1);
}
Outputs:
0x1.921f9f01b866ep+1
0xc.90fcf80dc337p-2
A printf in C code compiled with GCC prints the same as the printf
here.
Bye,
bearophile
Hello Tomek,
I've got a problem calling an immutable getter on an ordinary
object.
struct A {
float _pole;
float pole() immutable {
return _pole;
}
}
void main() {
A a;
auto x = a.pole; // Ouch!
}
Error: function hello.A.pole () immutable is not callable using
argument types ()
immutable
Hello Sam,
Don Wrote:
You need to call the delegate you've made.
I missed this key point.
So to summary:
int a=1;
int b=2;
1.nested function;
2.int c=(int a,int b){return a+b;}(a,b);
3.int c=(int,int){return a+b;}(a,b);
4.int c=(){return a+b;}();
5.int c={return a+b;}();
How come the last
1 - 100 of 235 matches
Mail list logo