Re: Can someone explain how mixin is implemented?

2011-05-19 Thread Matthew Ong
On 5/19/2011 1:23 AM, Jesse Phillips wrote: Matthew Ong Wrote: Perhaps I am missing something here. How can class level definition be part of the mixin? Does mixin generate the same binary code as #define as inline code,which meant that same binary is repeated everywhere that macro is used?

Re: Can someone explain how mixin is implemented?

2011-05-19 Thread Matthew Ong
On 5/19/2011 9:18 PM, Matthew Ong wrote: On 5/19/2011 1:23 AM, Jesse Phillips wrote: Matthew Ong Wrote: Perhaps I am missing something here. How can class level definition be part of the mixin? Does mixin generate the same binary code as #define as inline code,which meant that same binary is

(Windows) beginner woes....

2011-05-19 Thread Lloyd Dupont
1]. ok, I unzipped dmd.zip and dm.zip. what's this dm.zip for? 2]. I install Visual D, I had to point it to the DMD folder. And it did compile my 1st D program fine... doubly wondering what's dm for? 3]. I try installed DFL. Actuall it unzipped in the worng forlder, so I moved whateve in

import problem

2011-05-19 Thread Lloyd Dupont
so I copied the Entice generated UI code in Visual D, and tried to compile. I got 1 error: Error1Error: module all is in file 'dfl\all.d' which cannot be read C:\Dev\DTest\DTest1\myform.d7 On import dfl.all; For info I do have dfl.all in C:\D\dmd2\windows\import\dfl

Re: How to break module into multiple file.

2011-05-19 Thread Matthew Ong
On 5/14/2011 3:17 AM, Nick Sabalausky wrote: Jason Housejason.james.ho...@gmail.com wrote in message But yea, one-class-per-file is really a Java thing (and then a few other Not true entirely, the limit is one public class per file. There is no actual limit for such: // The file must be

Re: Can someone explain how mixin is implemented?

2011-05-19 Thread Steven Schveighoffer
On Thu, 19 May 2011 09:43:14 -0400, Matthew Ong on...@yahoo.com wrote: On 5/19/2011 2:32 AM, Jacob Carlborg wrote: Template mixins are not exactly like copy and paste code. * You can mixin the same template, at the same location, twice, taking different parameters * Mixed in methods doesn't

Re: Can someone explain how mixin is implemented?

2011-05-19 Thread Matthew Ong
On 5/19/2011 10:02 PM, Steven Schveighoffer wrote: On Thu, 19 May 2011 09:43:14 -0400, Matthew Ong on...@yahoo.com wrote: According to Jonathan, In the case of template mixins, you're essentially copying and pasting code. Yes. Liked what you said, with optimization at compiled time. I am

Re: How To Dynamic Web Rendering?

2011-05-19 Thread Matthew Ong
On 5/13/2011 4:01 AM, Nick Sabalausky wrote: Matthew Ongon...@yahoo.com wrote in message news:iqgo17$2nqv$1...@digitalmars.com... Hi Adam, Thanks again for the sharp pointed answer. What is the counterpart in D for replacing JSP/ASP/JRuby on Rail or some sort of dynamic web base development?

Re: How To Dynamic Web Rendering?

2011-05-19 Thread Adam D. Ruppe
Hmm...Might be problem for it to be main... Security concerned because of the publicity done my M$ and others also. When they pushed for ASP/JSP... That's such backward nonsense I find it hard to believe anyone would seriously believe it.

How to 'add' functions to existing type/class/struct/interface...

2011-05-19 Thread Matthew Ong
Hi All/Walter Bright, The ability is able to be model and done by JRuby and also Google Go. Conversions ... // this function is now available for the object type Sequence. Done outside of Sequence.d func (s Sequence) MyFunction() string { // My Function has access to all the

How to print unicode like: #12371; #12435; #12395; #12385; #12399; #19990; #30028;

2011-05-19 Thread Matthew Ong
Hi, import std.stdio; alias immutable(wchar)[] String; String str=Hello, world; or #922;#945;#955;#951;#956;#941;#961;#945; #954;#972;#963;#956;#949;; or #12371;#12435;#12395;#12385;#12399; #19990;#30028;; writeln(str); // It prints garbage on console. In Java and Go, that just works. I

Re: How to print unicode like: #12371; #12435; #12395; #12385; #12399; #19990; #30028;

2011-05-19 Thread Matthew Ong
AH... The web encoder corrupted the string. into NON human readable.

Re: How to print unicode like: #12371; #12435; #12395; #12385; #12399; #19990; #30028;

2011-05-19 Thread Adam D. Ruppe
Try using the hex unicode characters like this: \u0123 I don't think decimal characters like you put work in D strings. The name; syntax sometimes works but only for named chars, and you need to put a \ before them like this: writeln(\ldquo; hello \rdquo;); Prints: � hello � You'll have to

Re: How to print unicode like: #12371; #12435; #12395; #12385; #12399; #19990;#30028;

2011-05-19 Thread Robert Clipsham
On 19/05/2011 16:19, Matthew Ong wrote: On 5/19/2011 11:22 PM, Matthew Ong wrote: Hi, import std.stdio; alias immutable(wchar)[] String; String str=Hello, world; or#922;#945;#955;#951;#956;#941;#961;#945;#954;#972;#963;#956;#949;; or#12371;#12435;#12395;#12385;#12399;#19990;#30028;;

Re: Uri module in phobos

2011-05-19 Thread Adam D. Ruppe
My cgi.d module does more comprehensive stuff: http://arsdnet.net/dcode/cgi.d Look for decodeVariables and encodeVariables. They are pretty trivial function - split on the , then decode each part.

Re: import problem

2011-05-19 Thread Jesse Phillips
Jesse Phillips Wrote: Lloyd Dupont Wrote: so I copied the Entice generated UI code in Visual D, and tried to compile. I got 1 error: Error1Error: module all is in file 'dfl\all.d' which cannot be read C:\Dev\DTest\DTest1\myform.d7 On import dfl.all; For info I

Enforcing static closure

2011-05-19 Thread Piotr Szturmaj
I want to make a delegate of blocking I/O statement and pass it to a function. Then it will be called immediately. This delegate never escapes its creation scope, so I don't want heap closure allocation. Will compiler create dynamic closure (e.g. with allocation) or static closure (with

Re: Enforcing static closure

2011-05-19 Thread Steven Schveighoffer
On Thu, 19 May 2011 15:39:12 -0400, Piotr Szturmaj bncr...@jadamspam.pl wrote: I want to make a delegate of blocking I/O statement and pass it to a function. Then it will be called immediately. This delegate never escapes its creation scope, so I don't want heap closure allocation. Will

status of shared-libs on Windows?

2011-05-19 Thread Graham Fawcett
Hi folks, I've only used D on Linux so far, so I'm not clear on the current shared-library story on Windows. Consider an existing C++ application that can be extended by writing plugins, which are usually written in C or C++, and compiled as DLLs. Very generally speaking, is DMD capable of

Re: How to print unicode like: こ ん に ち は 世界

2011-05-19 Thread Andrej Mitrovic
Which OS?

Re: How to print unicode like: こ ん に ち は 世界

2011-05-19 Thread Andrej Mitrovic
If you're on Windows, you need to set the proper codepage for the console, you can do it programmatically like so: version(Windows) { import std.c.windows.windows; extern(Windows) BOOL SetConsoleOutputCP(UINT); } void main() { version(Windows) SetConsoleOutputCP(65001);

Re: status of shared-libs on Windows?

2011-05-19 Thread Trass3r
Am 19.05.2011, 22:28 Uhr, schrieb Graham Fawcett fawc...@uwindsor.ca: Hi folks, I've only used D on Linux so far, so I'm not clear on the current shared-library story on Windows. Consider an existing C++ application that can be extended by writing plugins, which are usually written in C or

Re: status of shared-libs on Windows?

2011-05-19 Thread Trass3r
(I've already successfully created and used Matlab .mex/.dll plugins with D)

Re: status of shared-libs on Windows?

2011-05-19 Thread Jimmy Cao
I've even created a dll that is used as a keylogger hook thing for Windows with only D.

.init of field == type's initializer or field initializer?

2011-05-19 Thread Andrej Mitrovic
From: http://d-programming-language.org/property.html .init Property: .init produces a constant expression that is the default initializer. If applied to a type, it is the default initializer for that type. If applied to a variable or field, it is the default initializer for that variable or

Re: .init of field == type's initializer or field initializer?

2011-05-19 Thread Jonathan M Davis
On 2011-05-19 20:19, Andrej Mitrovic wrote: From: http://d-programming-language.org/property.html .init Property: .init produces a constant expression that is the default initializer. If applied to a type, it is the default initializer for that type. If applied to a variable or field, it is

Re: .init of field == type's initializer or field initializer?

2011-05-19 Thread Andrej Mitrovic
It was in the docs like that actually.