Apache "mod_d" needs C to instantiate D interpreter?/D embedded in HTML

Robert Clipsham robert at octarineparrot.com
Tue Nov 9 11:13:51 PST 2010


On 09/11/10 14:24, JFD wrote:
>> Can't DMD already compile D code embedded in HTML:
>> http://www.digitalmars.com/d/2.0/html.html ?
>
> I tried the sample at the link, but got error.  I also tried it without the HTML
> code inside.  Am I missing something?
>
> $ dmd hello.html
> Error: module hello html source files is deprecated hello.html
>
> hello.html:
>
> --------------
> <html>
>    <body>
>      <code>
> import std.stdio;
>
> int main()
> {
>      writefln("Hello world");
>      return 0;
> }
>      </code>
>    </body>
> </html>
> --------------
>
> -or-
>
> --------------
> import std.stdio;
>
> int main()
> {
>      writefln("Hello world");
>      return 0;
> }
> --------------

Which version of dmd are you using? That code is for D 1.0/Phobos. 
You'll need to replace writefln with writeln for D2.

-- 
Robert
http://octarineparrot.com/


More information about the Digitalmars-d mailing list