On 11/30/2009 12:32 PM, Chad J wrote:
Ellery Newcomer wrote:
On 11/30/2009 03:53 AM, Ary Borenszweig wrote:
Chad J wrote:
Given an Expression object in dmd, I'd like to know how many
subexpressions it contains and, even better, iterate over them. I'd
like to do this in a general way, without
.
Here's some chicken scratch that more or less illustrates what I
envision going on (I can't attest that DMD's ASTs look exactly like
this, but I assume they're similar):
http://personal.utulsa.edu/~ellery-newcomer/scribble.png
How much effort it would entail is another matter though. I
Just switched back to 64 bit fedora, and wonder of wonders, dmd doesn't
work. Well, actually dmd sorta does. The linker doesn't. I'm getting
$ ./dmd test.d
/usr/bin/ld: crt1.o: No such file: No such file or directory
ideas?
dmd 2.036
On 11/21/2009 02:11 PM, Jesse Phillips wrote:
On Sat, 21 Nov 2009 14:01:23 -0600, Ellery Newcomer wrote:
Just switched back to 64 bit fedora, and wonder of wonders, dmd doesn't
work. Well, actually dmd sorta does. The linker doesn't. I'm getting
$ ./dmd test.d
/usr/bin/ld: crt1.o
A Bothe wrote:
Hey guys,
I've found a problem that occurred since DMD 2.034:
When I've created a dynamic array like
string[] a;
and I want to assign something via the index of this array
a[0]=Test;
DMD says the array isn't mutable...even if these are normal types like int or
char.
Trass3r wrote:
Ellery Newcomer schrieb:
auto array = new ubyte[][](width*height, numSprites);
params might be backwards..
Ah yeah, thanks, that was it.
Don't get the reason for that syntax.
I think it has something to do with uniformity inside templates or
something.
alias ubyte
given tak.d:
import std.stdio;
void main()
{
//int[1][2]([3][4] i[5][6])[7][8];
int i(I)(int){return 1;}
writeln(typeof(i).stringof);
}
$ dmd tak ./tak
spits out 'void'
does this make sense, or would it make more sense as an error for not
appending the template argument? Or would it
Ellery Newcomer wrote:
Is there currently any way to get something like
Tuple!(int,i) t = tuple(5);
to work?
Doh. It looks like
Tuple!(int,i) t = tuple!(int,i)(5);
should work, but I'm getting the following error
/home/ellery/download/dmd2035/dmd2/linux/bin/../../src/phobos/std
Is there currently any way to get something like
Tuple!(int,i) t = tuple(5);
to work?
Phil Deets wrote:
Hi, is there a way to add members to an enum based on conditional
compilation symbols. I tried
enum Tag {
A, B,
version (symbol) {
C, D,
}
E,
}
but it doesn't work. I know I could do
version (symbol) {
enum Tag { A, B, C, D, E }
} else {
grauzone wrote:
Saaa wrote:
public void addToAA(char[] var_name, KT, ET)(KT key, ET element)
{
mixin(ET.stringof~`[]* elements = key in `~var_name~`;`);
if( elements == null )
{
ET[] temp;
temp.length = 1;
temp[0] = element;
mixin(var_name~`[key] = temp;`);
}
This is probably a bad idea, but from my readings of the dmd source, I
noticed some preprocessor defines that looked useful, along the lines of
#define CASES case A:case B: (etc)
I'd kinda like something similar in D, but a naive attempt with mixins
doesn't work, e.g.
immutable string cases =
Jarrett Billingsley wrote:
On Sat, Oct 10, 2009 at 8:45 PM, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
This is probably a bad idea
A single string mixin must consist of an entire, fully-formed
statement, expression, or declaration (depending on where it's used).
Case labels do
Christopher Wright wrote:
Ellery Newcomer wrote:
Jarrett Billingsley wrote:
On Sat, Oct 10, 2009 at 8:45 PM, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
This is probably a bad idea
A single string mixin must consist of an entire, fully-formed
statement, expression, or declaration
Justin Johansson wrote:
Jarrett Billingsley Wrote:
On Thu, Oct 8, 2009 at 8:10 PM, Justin Johansson n...@spam.com wrote:
Thanks Jarrett.
Am I having a blonde day?
int[2,3] m = [ 1, 2, 3 ];
writefln( m=%s, .sizeof=%d, m, m.sizeof);
Compiles and prints:
m=[1,2,3],
Is there anything analogous to tango.text.Unicode.isPrintable in phobos?
Does the tango build by any chance set any distinguishing predefined
version identifiers?
Umm.. A shot in the dark?
void main(){
struct SomeStruct{
int* p;
void aa(int a){
*p = a;
}
}
class SomeClass{
int a;
SomeStruct foo(){
SomeStruct m;
m.g = a;
return m;
}
}
SomeClass inst = new SomeClass;
Steven Schveighoffer wrote:
On Sat, 29 Aug 2009 20:15:55 -0400, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
void blah(out bool a = false){
// blah blah blah
}
compile time use of blah results in error.
Am I doing anything wrong?
out implies a reference. You can't have
Why is function overloading not applied to nested functions?
--
As to your question:
class K{
alias static int B;
B b; // b is non-static
}
--
Curious. I didn't actually test the example, but I did for deprecated,
and it doesn't get
what is the purpose of the syntax
alias StorageClasses Declarator
?
(I just noticed my parser doesn't support it, but I don't see any reason to)
Jarrett Billingsley wrote:
On Sat, Aug 1, 2009 at 8:31 PM, Ellery
Newcomerellery-newco...@utulsa.edu wrote:
what is the purpose of the syntax
alias StorageClasses Declarator
?
I don't know where you're getting that grammar. Is that from the D spec?
um, yeah.
Declaration:
You mean how the compiler rejects alias const int x; but not alias
static int x;? That is strange..
I want to know why
alias static int x;
is allowed in the first place
From the specs:
It is not an error to have const module variable declarations without
initializers if there is no constructor. This is to support the practice
of having modules serve only as declarations that are not linked in, the
implementation of it will be in another module that is linked in.
I'm tired and witless just now, but I can't think of any reason why
assert should be an expression and not a statement.
Any clues?
when is symbol shadowing permitted/forbidden?
It appears that it is only forbidden in multiple levels of statements,
but not in multiple levels of declDefs
bearophile wrote:
I'm trying to convert to D2 the following (quite simplified up) Python code,
that implements a trampoline to run tail-call functions with no stack
overflow:
# Python code
# *args means almost all the arguments
def trampoline(fun, *args):
thunk = lambda : fun(*args)
BCS wrote:
Hello Ellery,
bearophile wrote:
I'm trying to convert to D2 the following (quite simplified up)
Python code, that implements a trampoline to run tail-call functions
with no stack overflow:
[...]
How DO you define the signature of a function that returns itself?
Last I
what is up with this code?
auto t = tuple(1,'a',3.333,false);
pragma(msg,typeof(t.tupleof[2 .. $]).stringof);
spits out
(double, bool, int, char, double, bool)
BCS wrote:
Hello Sam,
To save time ,just get to my point:I do not understand why such code
below inside the switch ... case statement is allowed ,what is the
point of do ... while...:
This is a classic C thing. The short explanation is that a switch is a
conditional, many way goto and
what is the purpose of the expression grammar
Expression:
AssignExpression
AssignExpression , Expression
?
(emphasis on the comma)
suggests that the above assumption will
generate a large proportion of false positives, or else the compiler
ignores a large proportion of true positives.
Ellery Newcomer wrote:
Hello.
When I have three files test1.d test2.d test3.d as follows:
module test1;
import tango.io.Stdout;
import test3
Hello.
When I have three files test1.d test2.d test3.d as follows:
module test1;
import tango.io.Stdout;
import test3;
static this(){
Stdout(test1\n);
}
module test2;
import test1;
//no ctor
module test3;
import tango.io.Stdout;
import test2;
static this(){
Stdout(test3\n);
}
and
Daniel Keep wrote:
TSalm wrote:
I'm not sure but I think package is not virtual.
:-(
So there's really no way to have a method declared package in an
interface ?
You also can't have a private function in an interface. This once lost
me four days trying to figure out why my program wouldn't
BCS wrote:
I don't understand your question. Are you suggesting that something be
added or asking why something is allowed?
Why is it allowed?
for example:
int myfun(int=10);
is there any reason to allow
BasicType AnonymousDeclarator = AssignExpression
as a parameter? As far as I know, it's gibberish (but, then, I don't
know very far).
Ellery Newcomer wrote:
Hello all,
I began learning D a few months ago, and now I have a question about
cyclic dependencies (and some random whining).
I come from a java background and have had no serious exposure to C++.
In java, cyclic dependencies are legit to the best of my knowledge. I
taqya wrote:
Hi,i write this code. then d compiler is shutdown.
Is it a array bug?
//Digital Mars D Compiler v2.014 (windows)
import std.stdio;
int main()
{
char[] a = a.dup;
char[] b = b.dup;
writefln(a + b); //Error: Array operations not implemented
return 0;
}
BCS wrote:
Reply to Ellery,
I don't buy that. Not that I'm a C guru or anything, but it looks to
me that Parser::BaseClasses could be easily edited to make the point
in question go away.
it's not a parser thing but a grammar thing. It would be complex to
define a grammar that allows one
Derek Parnell wrote:
It is not a bug. A string literal such as true is a char[] type
(UTF8),
and the compiler will not implicitly convert UTF8 to UTF16 (wchar[]).
Which would then beg the obvious
wchar[] w = true;
Hello all,
I began learning D a few months ago, and now I have a question about
cyclic dependencies (and some random whining).
I come from a java background and have had no serious exposure to C++.
In java, cyclic dependencies are legit to the best of my knowledge. I
don't know about C++,
301 - 342 of 342 matches
Mail list logo