Anybody got an idea?
Thank you Adam,
Your code is comprehensive. I will read it closely for ideas.
I seek a minimalist approach for locally run applications.
> In GCC there is a way to (sometimes) do it, see the __builtin_constant_p here:
> http://www.delorie.com/gnu/docs/gcc/gcc_81.html
Google code search gives about 8,100 answers:
http://www.google.com/codesearch#search/&q=%22__builtin_constant_p%22&type=cs
Bye,
bearophile
scarrow:
> I'd really like to figure out how to have Hash("foo") be static and
> Hash(variable) be dynamic.
In GCC there is a way to (sometimes) do it, see the __builtin_constant_p here:
http://www.delorie.com/gnu/docs/gcc/gcc_81.html
Time ago I have asked for something similar in D too, becaus
I think invoking a template to call the pure function (StaticEval!(Hash("foo"))
isn't much different from StaticHash!("foo"). You still have to explicitly know
whether you're dealing with a compile time constant or not. I'd really like to
figure out how to have Hash("foo") be static and Hash(vari
On 2011-07-14 20:42, Cecil ward wrote:
If I pass lazy expressions or delegates to as arguments to functions, what
happens with variables mentioned in the
lazy expression or in the delegate body if those variables are on the stack or
otherwise out of scope, or are objects
that may be freed? Does
If I pass lazy expressions or delegates to as arguments to functions, what
happens with variables mentioned in the
lazy expression or in the delegate body if those variables are on the stack or
otherwise out of scope, or are objects
that may be freed? Does the compiler partially protect the progr
On Thu, 14 Jul 2011 13:05:33 -0400, Steven Schveighoffer wrote:
> On Thu, 14 Jul 2011 09:36:47 -0400, Graham Fawcett
> wrote:
>
>> On Thu, 14 Jul 2011 09:01:29 +, hasnoth wrote:
>>
>>> auto file = io.File("test.txt", "rb");
>>> auto fp = file.getFP();
>>> int x;
>>> io.fread(&x, x.size
On Thu, 14 Jul 2011 09:36:47 -0400, Graham Fawcett
wrote:
On Thu, 14 Jul 2011 09:01:29 +, hasnoth wrote:
auto file = io.File("test.txt", "rb");
auto fp = file.getFP();
int x;
io.fread(&x, x.sizeof, 1, fp);
what's the d method to do that?
The same method:
import core.stdc.s
Am 14.07.2011, 16:36 Uhr, schrieb Danny Arends :
Hey all,
I'm trying to build a D application which statically links in the the
blas and lapack libraries
(from http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html ).
When downloading the
pre-build libraries from the website I link th
Hey all,
I'm trying to build a D application which statically links in the the blas
and lapack libraries
(from http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html ). When
downloading the
pre-build libraries from the website I link them in using:
pragma(lib, "blas");
pragma(lib, "lapack");
std.socket is too low level for serving webpages. It just provides
the means to talk on the network, but doesn't do any application
protocols like http.
I've written a little http server in D, but it uses linux system
calls instead of std.socket, so it only works on linux.
http://arsdnet.net/dcod
The program as such can regurgitate a web page provided these additional lines:
string webpage = "index.html";
string output = "HTTP/1.1 200 OK\r\n Content-Type: text/html;
charset=UTF-8\r\n\r
\n" ~ to!string(read(webpage) ~ "\r\n";
This does not serve a page as localhost:port/webpage.html, but
Cast to ubyte* and slice?
ubyte[] array = (cast(ubyte*)pointer)[0..length];
"teo" wrote in message
news:ivn0n8$14ig$1...@digitalmars.com...
> Is there any way of wrapping a void* by a ubyte[] array? The void* comes
> from mmap.
On Thu, 14 Jul 2011 17:07:20 +0200, teo wrote:
Is there any way of wrapping a void* by a ubyte[] array? The void* comes
from mmap.
byte[] array = cast(ubyte[])mmap(addr, length, ...)[0..length;]
--
Simen
On 2011-07-14 17:06, Danny Arends wrote:
Wow THANX,
Using the COFF2OMF tool at least got me a step further, now it finds and
accepts the lib files,
however, it now fails with the following error:
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
h
Wow THANX,
Using the COFF2OMF tool at least got me a step further, now it finds and
accepts the lib files,
however, it now fails with the following error:
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
Is there any way of wrapping a void* by a ubyte[] array? The void* comes
from mmap.
You need to convert the libraries to OMF format from COFF.
These are some tools which can do this:
Coffimplib: http://www.digitalmars.com/ctg/coffimplib.html
Coff2OMF: http://www.digitalmars.com/ctg/coff2omf.html
ObjConv: http://www.agner.org/optimize/objconv.zip
Hey all,
I'm trying to build a D application which statically links in the the blas and
lapack libraries
(from http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html ). When
downloading the
pre-build libraries from the website I link them in using:
pragma(lib, "blas");
pragma(lib, "lapack"
On Thu, 14 Jul 2011 09:01:29 +, hasnoth wrote:
> auto file = io.File("test.txt", "rb");
> auto fp = file.getFP();
> int x;
> io.fread(&x, x.sizeof, 1, fp);
>
> what's the d method to do that?
The same method:
import core.stdc.stdio : fread;
fread(&x, x.sizeof, 1, fp);
or, if you
I don't think there's a bug report specifically on this.
"bearophile" wrote in message
news:ivmigl$98a$1...@digitalmars.com...
> Daniel Murphy:
>
>> Yeah, type deduction with modifiers is inconsistent.
>>
>> In some cases matching T to const(U) gives U == tailconst(T), but not in
>> others.
>> T
Daniel Murphy:
> Yeah, type deduction with modifiers is inconsistent.
>
> In some cases matching T to const(U) gives U == tailconst(T), but not in
> others.
> The problem exists with pointers, arrays, and (if we ever get it) Michel
> Fortin's const(Object)ref.
Is this already in Bugzilla, or d
Yeah, type deduction with modifiers is inconsistent.
In some cases matching T to const(U) gives U == tailconst(T), but not in
others.
The problem exists with pointers, arrays, and (if we ever get it) Michel
Fortin's const(Object)ref.
A big part of the problem is that it can match with implicit
A D2 program:
T[] foo(T)(const T[] x) {
//static assert(is(U == int)); // false
static assert(is(T == const(int)));
return new T[1];
}
U[] bar(U)(const U[] y) {
static assert(is(U == int));
return foo(y);
}
void main() {
bar([1]);
}
DMD 2.054 gives:
test.d(8): Error: can
auto file = io.File("test.txt", "rb");
auto fp = file.getFP();
int x;
io.fread(&x, x.sizeof, 1, fp);
what's the �d method� to do that?
26 matches
Mail list logo