and you can NOT
going to be using the data in other CPU architectures, then the simplest is
to just copy out the RAM bytes to disk. Of course, you have to add some
'structure' info to deal with the variable-length arrays but that can be as
simple as prefixing the data with the length value.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
tData)
{
SomeAttribute = InitData;
}
// A method
int A_Method()
{
return SomeAttribute;
}
}
- end of file -
The line to compile these ...
dmd myprogram myclass
When running the program 'myprogram' you should get ...
c:\>myprogram
First 1
Second 5
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
d in that way no
conversion is required.
If for some reason you did want a run-time conversion then this should work
...
wchar[] w = std.utf.toUTF16((true)? "true":"false");
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ou have to do it the long way ...
a.length = a.length + 30;
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ts the
ability to have the compiler build class objects at compile-time such that
when a program first starts running, the objects are already fully formed
in RAM just waiting to be used.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Fri, 19 Dec 2008 04:07:40 -0500, Kagamin wrote:
> Derek Parnell Wrote:
>
>> A static constructor (also known as the Module constructor) executes at
>> program run-time and not at program compile-time.
>
> So do C++ static object constructors. Though C++ has synt
that
information in the mario.d source file.
eg.
version(build) { pramga(link, alleg); }
Then you no longer have to keep typing into the Bud command line, instead
you just say ...
build mario
Use the return code from Bud to see if you can run the compiled program ...
if errorlevel 0 mario
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
d to use 'ints' as bool values you have to provide your own
conversion routine. For example ...
int[] a = [1,2,3,0];
bool[] b;
-- Convert to int array to bool array.
b.length = a.length;
foreach( i, x; a)
b[i] = (x != 0);
writefln(a,`-->`,b);
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ni is not in any of these places.
Which location DO you actually have sc.ini in?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ve sc.ini in?
>>>>
>>>> --
I do not understand your answer.
Can you tell us the full path that contains sc.ini?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ils because of the literal '3'. The compiler cannot be sure if you
want the 'int' or 'uint' function called because '3' matches both of them.
You need to make the literal explicit...
tblah(3u); -- uint call
tblah(cast(int)3);
* p;
> int[3] s;
> p = s;
Try ...
int* p;
int[3] s;
p = s.ptr;
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
o it in Bud by not having DMD invoke the linker,
instead I have Bud invoke the linker with the right options.
The easiest way is to delete the .map files after compiling.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
>
> Oh, I figured either opEquals would be defined in terms of opCmp or an
> overloaded opCmp would imply a new opEquals defined in terms of it, or
> something like that.
See http://www.digitalmars.com/d/1.0/operatoroverloading.html for actual
list.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
10 ;
b ~= 11 ;
b[0] = 12 ;
The result should now be:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[12, 2, 3, 4, 5, 6, 7, 8, 9, 11]
So remember, assigning one array to another is just creating an alias to
the original array. You end up with two arrays pointing to the same data
buffer.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 21 May 2009 05:37:59 -0400, MLT wrote:
> Derek Parnell Wrote:
>
>>
>> So remember, assigning one array to another is just creating an alias to
>> the original array. You end up with two arrays pointing to the same data
>> buffer.
>
> Yes. My question
hat is passedon the stack, so changing that will not change
the argument's properties.
eg.
void func(int[] x)
{
x.length = x.length + 1;
}
int a[] = [1,2,3];
func(a);
writefln("%s", a) //--> [1,2,3] and not [1,2,3,0]
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
:
STATEMENTS...
case VAL2:
STATEMENTS...
case VAL3:
STATEMENTS...
}
would only execute ONE of the selected cases.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
You're correct in that version{} is no help at all. I use a text macro
program to help me.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ource.org/projects/build
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Mon, 15 Jun 2009 15:06:24 +1200, Tim Matthews wrote:
> Derek Parnell wrote:
>> On Sun, 14 Jun 2009 15:16:51 + (UTC), Michal Minich wrote:
>>
>>> Is there any tool for Linux that can parse imports of files and invoke
>>> compiler with all project files? (
e yourself??
I've actually given up trying to influence D ... the patricians have made
it too hard to contribute and I've haven't got *that* much free time.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
these characters (I
> am using CP932) and you need an font that can represent these
> characters. I assume OP already has both. Note that CP65001 does not
> work.)
I'm having troubles with this ...
C:\temp>chcp 932
Invalid code page
C:\temp>chcp 65001
Active code page: 650
I see that the syntax for 'switch' is ...
switch ( Expression ) ScopeStatement
and ScopeStatement is either a BlockStatement or a NonEmptyStatement.
Meaning that
switch (i) j = k;
is valid syntax! Why is that?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Mon, 06 Jul 2009 22:10:20 -0400, bearophile wrote:
> Derek Parnell:
>> is valid syntax! Why is that?
>
> To allow train-wrecks like this one:
>
> version(Tango) import tango.stdc.stdio;
> void main(char[][] args) {
> if (args.length > 1)
> switch (args
th it. While I've
> just seen DMD2 produces an output file. Is this a D1 bug?
I get exactly the same thing. Running with D1 gives an empty file and
running with D2 gives a file with content. I'd say it looks like a bug, so
bugzilla, here I come :-)
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
se "1": Stdout("1"); // break; //uncomment and error
}
Ok, why on earth would a one-case switch be useful? And that still doesn't
help me understand why allowing other statement types in that position is a
good idea.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
27 matches
Mail list logo