http://ftp.digitalmars.com/dmd1beta.zip
Mainly for those daring folks who want to help develop it further:
$(LI 80 bit reals are truncated to 64 bits when formatting.)
$(LI Many math functions are not implemented.)
$(LI No symbolic debug info is generated.)
$(LI
On 9/27/12, Walter Bright newshou...@digitalmars.com wrote:
D will probably not bother with the 64 bit SEH.
How come, and what will be the consequences of this?
Anyway great work so far!
On 2012-09-27 15:42, Andrej Mitrovic wrote:
On 9/27/12, Walter Bright newshou...@digitalmars.com wrote:
D will probably not bother with the 64 bit SEH.
How come, and what will be the consequences of this?
Anyway great work so far!
What he said. What about this:
On Thursday, 27 September 2012 at 15:00:23 UTC, Jacob Carlborg
wrote:
On 2012-09-27 15:42, Andrej Mitrovic wrote:
On 9/27/12, Walter Bright newshou...@digitalmars.com wrote:
D will probably not bother with the 64 bit SEH.
How come, and what will be the consequences of this?
Anyway great
On 09/26/2012 08:49 PM, Mike James wrote:
Mike Wey wrote in message news:k2isv4$2r67$1...@digitalmars.com...
GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL
license.
With 2.0 GtkD will wrap Gtk+ version 3, if you need Gtk+ 2 you can use
the latest version from the Gtk2
On 09/27/2012 01:56 PM, bearophile wrote:
Walter Bright:
http://ftp.digitalmars.com/dmd1beta.zip
How do I switch from producing a 32 bit to 64 binary? I am looking for a
-b64 or -b32 or similar switch...
Bye,
bearophile
-m32 and -m64 ? i'ts what dmd uses on linux.
--
Mike Wey
Mike Wey:
-m32 and -m64 ? i'ts what dmd uses on linux.
Are those usable on DMD-Windows64 too?
Bye,
bearophile
On 9/27/2012 4:56 AM, bearophile wrote:
How do I switch from producing a 32 bit to 64 binary?
-m64
I made glfw3 bindings (translated the C headers to D):
https://github.com/Dav1dde/glfw3
Can someone make a deimos repo?
Sure, why not?
On 8/31/2012 11:47 AM, Knud Soerensen wrote:
Super, the same night the local hacker space (osaa.dk) makes Tech Talk
Tuesday. Which consider of short talks (15-30 min.) with technical
focus. I was woundering if you would consider giving a short talk about D.
Love
Knud
On
Hi,
I have same issue, but it is possible make shared library,
first of all you have to make shared variant of druntime and
phobos library, than it should work ok.
Now I am at work, when I come back home I will post some more
details about this.
Daniel Kozak
On Wednesday, 26 September
On 2012-09-27 00:38, bearophile wrote:
I have appreciated named fields of D tuples since the beginning, I have
found them quite handy. With them sometimes you don't need to unpack a
tuple, you can just access its fields with a nice name, avoiding to move
around more than one variable.
If you
Now I try it, and it is not required to build shared variant of
druntime and phobos, only rebuild it with -fPIC
On Thursday, 27 September 2012 at 06:12:38 UTC, Daniel Kozak
wrote:
Hi,
I have same issue, but it is possible make shared library,
first of all you have to make shared variant of
On Wednesday, 26 September 2012 at 20:15:35 UTC, nazriel wrote:
On Wednesday, 26 September 2012 at 20:10:47 UTC, Michael wrote:
Thanks. The loading part is very useful, but I'm still lost
when it comes to build the shared library itself.
Andrei
Program loads dll at runtime using loader
On Wednesday, 26 September 2012 at 22:23:00 UTC, Nick Sabalausky
wrote:
On Wed, 26 Sep 2012 10:37:10 -0700
H. S. Teoh hst...@quickfur.ath.cx wrote:
wide images get clipped with no way to unclip them when using
the
mobile stylesheet (probably the same bug you describe above),
etc..
And Apple
On 27 September 2012 03:14, Brad Roberts bra...@puremagic.com wrote:
On Wed, 26 Sep 2012, H. S. Teoh wrote:
On Wed, Sep 26, 2012 at 05:58:08PM -0700, Brad Roberts wrote:
[...]
I don't know what's involved in getting built-packages into the
various distributions. I suspect that a number of
On 9/27/2012 12:02 AM, Iain Buclaw wrote:
On 27 September 2012 03:14, Brad Roberts bra...@puremagic.com wrote:
#4 there implies it's a source package, though I could be mis-interpreting
you. Is there a path for externally built binary packages? That's fairly
counter to the general
Am Thu, 27 Sep 2012 08:26:36 +0200
schrieb Daniel Kozak kozz...@gmail.com:
Now I try it, and it is not required to build shared variant of
druntime and phobos, only rebuild it with -fPIC
In the end you'll probably need a shared druntime phobos: Let's say
your main app doesn't use
Am Wed, 26 Sep 2012 17:35:18 +0200
schrieb Don Clugston d...@nospam.com:
On 26/09/12 17:13, Johannes Pfau wrote:
The frexp test fails on ARM. I think the mask in line 1491 is
wrong:
https://github.com/D-Programming-Language/phobos/blob/master/std/math.d#L1491
For doubles, the 63 bit is
On Thursday, 27 September 2012 at 05:52:44 UTC, Jens Mueller
wrote:
Maxim Fomin wrote:
You can build shared libraries on linux by manually compiling
object
files and linking them. On windows last time I tries it was not
possible.
Can you give detailed steps for doing this on Linux? Because
On 2012-09-27 09:02, Iain Buclaw wrote:
For #4, yes. Ubuntu is a better platform to approach for externally
built binary-only packages. But for debian, you could possibly do
something similar to how eg: the flash-plugin installer package works
- downloads the tar.gz/zip from an external site,
On 2012-09-27 10:04, Maxim Fomin wrote:
On Thursday, 27 September 2012 at 05:52:44 UTC, Jens Mueller
wrote:
Maxim Fomin wrote:
You can build shared libraries on linux by manually compiling object
files and linking them. On windows last time I tries it was not
possible.
Can you give detailed
Jacob Carlborg wrote:
On 2012-09-27 10:04, Maxim Fomin wrote:
On Thursday, 27 September 2012 at 05:52:44 UTC, Jens Mueller
wrote:
Maxim Fomin wrote:
You can build shared libraries on linux by manually compiling object
files and linking them. On windows last time I tries it was not
possible.
On Thursday, 27 September 2012 at 08:26:08 UTC, Jacob Carlborg
wrote:
1. Does this actually run?
If it were non-runnable, I wouldn't posted it.
2. This is statically linked with druntime and Phobos. What
happens when you create an executable that links with the D
dynamic library?
On 2012-09-27 10:55, Maxim Fomin wrote:
If it were non-runnable, I wouldn't posted it.
Ok, I see.
Solution depends on a problem. I understood Andrei's post that he wanted
a .so file or DLL. I told originally that it is possible to make shared
libraries on linux. Now I see there is some
On Wednesday, 26 September 2012 at 21:31:13 UTC, Jonathan M Davis
wrote:
On Wednesday, September 26, 2012 21:54:44 foobar wrote:
Library tuples have broken semantics.
Tuples supposed to have _structural_ typing which AFAIK can
only
be correctly implemented in language.
import
On 27/09/12 09:20, Brad Roberts wrote:
On reflection, #4 is not going to work for dmd.. neither ubuntu nor debian, nor
most distributions are going to be happy
with the license situation.
Would Debian have a problem with a dmd package in non-free? Would Ubuntu have a
problem with it in the
On Wednesday, 26 September 2012 at 23:02:45 UTC, Piotr Szturmaj
wrote:
Jonathan M Davis wrote:
It sounds to me like the reason that structural typing is
needed is because
Tuple allows you to name its fields, which I've always thought
was a bad idea,
and which a built-in tuple definitely
On 26-09-2012 19:23, Jonathan M Davis wrote:
On Wednesday, September 26, 2012 17:12:49 Alex Rønne Petersen wrote:
On 26-09-2012 15:34, monarch_dodra wrote:
IMO: useful behavior would be if it was explicitly illegal to modify (or
modify + read) the same value twice in the same expression. I'd
On 26/09/12 17:46, David Nadlinger wrote:
Joseph, Russel, you seem to be both personally interested in D/LDC and quite
knowledgeable about Debian-style packaging. Might I suggest that you think about
joining the LDC forces as a package maintainer? It certainly isn't a huge amount
of work to do,
On Thursday, 27 September 2012 at 09:16:48 UTC, Jacob Carlborg
wrote:
On 2012-09-27 10:55, Maxim Fomin wrote:
If it were non-runnable, I wouldn't posted it.
Ok, I see.
Solution depends on a problem. I understood Andrei's post that
he wanted
a .so file or DLL. I told originally that it is
On 25/09/12 18:36, monarch_dodra wrote:
Thank you for bringing it up. The problem is indeed as you said, and making the
PRNGs references types fixes it.
I have a pretty well developed first iteration. I hope that by the end of next
week, I'll have something to show.
That would be fantastic.
On 26/09/2012 15:56, Mike James wrote:
Hi,
After a recent Windows update cycle the Visual D projects now fail to
build - it can't find the D source files - the output from compiler is
below.
===
OPTLINK (R) for
On 27 September 2012 11:02, Joseph Rushton Wakeling
joseph.wakel...@webdrake.net wrote:
On 26/09/12 17:46, David Nadlinger wrote:
Joseph, Russel, you seem to be both personally interested in D/LDC and
quite
knowledgeable about Debian-style packaging. Might I suggest that you think
about
On 27/09/12 12:11, Iain Buclaw wrote:
I also managed to royally screw up when going through beginners' packaging
instructions for Ubuntu, so I'm not sure I'm the best choice here ... :-\
I'd advise to retrieve the LLVM source package and tailor for LDC
instead rather than building from
On Thursday, 27 September 2012 at 08:26:08 UTC, Jacob Carlborg
wrote:
Last time I tried this (on Mac OS X) I got several symbols
missing. This was all symbols that are usually pointing to the
executable, inserted by the compiler. One of them would be
main and symbols like these:
On 9/26/2012 5:04 AM, Timon Gehr wrote:
Why should the calling convention have an impact on code
semantics?
Maximizing performance.
The code reads LTR, therefore evaluation should consistently be LTR.
The best order is the one that generates the fewest temporaries, and that's the
order
On 27 September 2012 11:27, Joseph Rushton Wakeling
joseph.wakel...@webdrake.net wrote:
On 27/09/12 12:11, Iain Buclaw wrote:
I also managed to royally screw up when going through beginners'
packaging
instructions for Ubuntu, so I'm not sure I'm the best choice here ... :-\
I'd advise to
Oops, didn't notice that this had already been mentioned in the other
copy of the post :-(
On Thursday, September 27, 2012 11:37:10 foobar wrote:
I do _not_ want to consider two different _structs_ (nominal
types) as the same type. I would like to get correct tuple
semantics which means _structural_ typing (I thought I emphasized
that enough in the OP).
A tuple is defined by its
On 27 September 2012 11:38, Walter Bright newshou...@digitalmars.com wrote:
On 9/26/2012 5:04 AM, Timon Gehr wrote:
Why should the calling convention have an impact on code
semantics?
Maximizing performance.
The code reads LTR, therefore evaluation should consistently be LTR.
The best
On 26 September 2012 20:28, Rainer Schuetze r.sagita...@gmx.de wrote:
I think this should be allowed, aswell as implementing forward declared
enums and structs (IIRC the compiler even has some error messages that
suggest that it is intended).
As a workaround, you could put your prototypes
On Wed, 26 Sep 2012 15:54:44 -0400, foobar f...@bar.com wrote:
On Tuesday, 25 September 2012 at 21:02:49 UTC, Andrei Alexandrescu wrote:
I agree. That's why I want to take the minimum amount of steps to make
library tuples work. That minimum amount may be 1, i.e. just implement
Walter Bright:
The best order is the one that generates the fewest
temporaries, and that's the order that should be defined for D.
Java and Python and C# give a precedent, maybe many programmers
expect a behavior like those ones.
Bye,
bearophile
On 9/27/12 1:00 AM, Philippe Sigaud wrote:
On Thu, Sep 27, 2012 at 1:30 AM, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
You are great, too, and would be even greater if you finalized your parser
generator and submitted it to Phobos. Most of the questions I get asked at
On 9/27/12 2:26 AM, Daniel Kozak wrote:
Now I try it, and it is not required to build shared variant of druntime
and phobos, only rebuild it with -fPIC
Could you please send a troika composed of one dynlib, one loader using
it, and a makefile that puts the all together?
Thanks much!
On 09/27/2012 12:38 PM, Walter Bright wrote:
On 9/26/2012 5:04 AM, Timon Gehr wrote:
Why should the calling convention have an impact on code
semantics?
Maximizing performance.
Optimisations by definition do not have an impact on code semantics.
The code reads LTR, therefore evaluation
On 09/27/2012 01:43 PM, bearophile wrote:
Walter Bright:
The best order is the one that generates the fewest temporaries, and
that's the order that should be defined for D.
Java and Python and C# give a precedent, maybe many programmers expect a
behavior like those ones.
Well, those can
On Thursday, 27 September 2012 at 10:43:08 UTC, Iain Buclaw wrote:
I meant clang. :-)
Clang is an entirely different story, because it is built as part
of the LLVM source tree/build process, checked out into
llvm/tools/clang (at least usually, don't know if it's possible
to build it
Le 26/09/2012 00:10, Andrei Alexandrescu a écrit :
There's quite a few changes that we're very excited about, that I'd love
to share to the extent possible.
First, we have decided to extend commit rights to Daniel Murphy and
Martin Nowak, two heavyweight dmd contributors better known under
On Thursday, 27 September 2012 at 08:03:34 UTC, Maxim Fomin wrote:
On Thursday, 27 September 2012 at 05:52:44 UTC, Jens Mueller
wrote:
Maxim Fomin wrote:
You can build shared libraries on linux by manually compiling
object
files and linking them. On windows last time I tries it was
not
On Thursday, 27 September 2012 at 10:58:12 UTC, Jonathan M Davis
wrote:
On Thursday, September 27, 2012 11:37:10 foobar wrote:
I do _not_ want to consider two different _structs_ (nominal
types) as the same type. I would like to get correct tuple
semantics which means _structural_ typing (I
On 27/09/12 12:43, Iain Buclaw wrote:
The source package for clang has mostly everything set-up for you.
Source deps, Binary deps, etc. I'd imagine the build process would be
similar, just a case of replacing the clang sources with ldc, and
tweaking the rules file to pick up ldc-specific
On 2012-09-27 12:02, Daniel Kozak wrote:
With DMD 2.060 last two points are possible, only first point (Using a
shared ...) I dont try
I really need to try this when I get home.
--
/Jacob Carlborg
Hi all,
I try to find hmac in phobos, but I dont find anything. Is there
some unnoficial library for D which I can use?
Daniel Kozak
Daniel Kozak wrote:
Hi all,
I try to find hmac in phobos, but I dont find anything. Is there some
unnoficial library for D which I can use?
Daniel Kozak
Piotr Szturmaj wrote:
Daniel Kozak wrote:
Hi all,
I try to find hmac in phobos, but I dont find anything. Is there some
unnoficial library for D which I can use?
Daniel Kozak
Oops, I accidentally clicked Send button...
You'll find HMAC and SHA here:
On Thu, Sep 27, 2012 at 11:46:12AM +0200, Joseph Rushton Wakeling wrote:
On 27/09/12 09:20, Brad Roberts wrote:
On reflection, #4 is not going to work for dmd.. neither ubuntu nor
debian, nor most distributions are going to be happy with the license
situation.
Would Debian have a problem
On Wed, Sep 26, 2012 at 07:14:12PM -0700, Brad Roberts wrote:
On Wed, 26 Sep 2012, H. S. Teoh wrote:
On Wed, Sep 26, 2012 at 05:58:08PM -0700, Brad Roberts wrote:
[...]
I don't know what's involved in getting built-packages into the
various distributions. I suspect that a number of
On Thursday, 27 September 2012 at 02:07:32 UTC, Brad Roberts
wrote:
That works well for packages which are single source tree. The
current
dmd, druntime, phobos, d-programming-language, tools separation
makes that
a little more challenging to put together, but not a lot. It's
probably
worth
On 2012-09-27 11:46, Joseph Rushton Wakeling wrote:
Would Debian have a problem with a dmd package in non-free? Would
Ubuntu have a problem with it in the multiverse or partner repositories?
Doesn't at least Ubuntu proprietary software, like drivers?
--
/Jacob Carlborg
On Thu, Sep 27, 2012 at 12:20:46AM -0700, Brad Roberts wrote:
On 9/27/2012 12:02 AM, Iain Buclaw wrote:
[...]
For #4, yes. Ubuntu is a better platform to approach for externally
built binary-only packages. But for debian, you could possibly do
something similar to how eg: the flash-plugin
Thanks,
old code is good enought :), it works perfectly
Daniel Kozak
On Thursday, 27 September 2012 at 14:34:07 UTC, Piotr Szturmaj
wrote:
Piotr Szturmaj wrote:
Daniel Kozak wrote:
Hi all,
I try to find hmac in phobos, but I dont find anything. Is
there some
unnoficial library for D
On Thursday, 27 September 2012 at 00:51:29 UTC, Brad Roberts
wrote:
I have on my personal todo list a few major items (among many
others):
1) add support for multiple projects (dmd2 being the only one
currently)
2) add packaging of built artifacts for master builds
3) add uploading of
On Wednesday, 26 September 2012 at 12:20:56 UTC, Dmitry Olshansky
wrote:
On 25-Sep-12 23:29, kenji hara wrote:
My suggestion is very simple.
1. Change all words built-in tuple in the documentation to
built-in
sequence. Then, in the D language world, we can have clarify
name for
the built-in
On Thursday, 27 September 2012 at 13:00:24 UTC, nazriel wrote:
Btw, sorry for OT.
What exactly doesn't work in Dpaste? It seems to work fine for
me(TM).
If those are UI glitches, try pressing F5 2-3 times ;D
Dpaste was completely down when I tried to post code. It was in
the middle of
On Sep 27, 2012, at 12:20 AM, Brad Roberts bra...@puremagic.com wrote:
On 9/27/2012 12:02 AM, Iain Buclaw wrote:
On 27 September 2012 03:14, Brad Roberts bra...@puremagic.com wrote:
#4 there implies it's a source package, though I could be mis-interpreting
you. Is there a path for
On 2012-09-27 10:55, Maxim Fomin wrote:
On Thursday, 27 September 2012 at 08:26:08 UTC, Jacob Carlborg wrote:
1. Does this actually run?
If it were non-runnable, I wouldn't posted it.
2. This is statically linked with druntime and Phobos. What happens
when you create an executable that
On 9/27/12 6:26 AM, Maxim Fomin wrote:
[snip]
Thanks! I adapted your code as follows and it works with 2.058 on Centos.
*** lib.d
import std.stdio;
extern(C) int fun()
{
writeln(, world!);
return 42;
}
*** main.d
import std.stdio;
extern(C) int fun();
void main()
{
write(Hello);
On 2012-09-27 20:25, Andrei Alexandrescu wrote:
On 9/27/12 6:26 AM, Maxim Fomin wrote:
[snip]
Thanks! I adapted your code as follows and it works with 2.058 on Centos.
I seriously doubt that everything is working properly, have a look at my
reply to Maxim Fomin:
On Thursday, 27 September 2012 at 17:10:07 UTC, Jacob Carlborg
wrote:
On 2012-09-27 10:55, Maxim Fomin wrote:
On Thursday, 27 September 2012 at 08:26:08 UTC, Jacob Carlborg
wrote:
1. Does this actually run?
If it were non-runnable, I wouldn't posted it.
2. This is statically linked with
On 9/27/12 3:37 PM, Maxim Fomin wrote:
Posted code doesn't load libraries at runtime, it is just linked to
shared libraries.
Exactly! (I can't believe I'm starting to get the hang of this...) But
what we ultimately need is true dynamic loading of never-seen modules.
After the initial test I
On Thu, 2012-09-27 at 07:50 -0700, H. S. Teoh wrote:
[…]
Yeah that's the other way to do it: build your own .deb's, and create an
apt repository on dlang.org (or somewhere), then publish the repository
URL. Then users can simply add the URL to /etc/apt/sources.list, and
they will be able to
On Wed, 2012-09-26 at 17:46 +0200, David Nadlinger wrote:
[…]
Joseph, Russel, you seem to be both personally interested in
D/LDC and quite knowledgeable about Debian-style packaging. Might
I suggest that you think about joining the LDC forces as a
package maintainer? It certainly isn't a
int, string a = 1, hello;
int, string foo(double, double a) {
return cast(int) (d[0] * d[1]), hello;
}
This is incompatible with current language specs (or will ends
up with highly bizantine rules do define what to do, in a topic
where it is already complex).
Which parts exactly are
For me to get C or C++ to run a D function, I had to do the
following:
//
// C/C++ library source
//
// sample D function from library
void foo(int i, int j, int k);
// D runtime initialization shutdown
void init();
void done();
void bar()
{
On 28/09/12 00:31, Russel Winder wrote:
Having a D apt repository remains a good move. In fact isn't there one
already? It's contents could be widened to include all deb from D stuff.
There certainly used to be, but IIRC it has fallen into disuse.
But it's still better to have packages in the
On Thursday, 27 September 2012 at 07:54:29 UTC, Johannes Pfau
wrote:
Am Thu, 27 Sep 2012 08:26:36 +0200
schrieb Daniel Kozak kozz...@gmail.com:
Now I try it, and it is not required to build shared variant
of druntime and phobos, only rebuild it with -fPIC
In the end you'll probably need a
Most comparisons between Go and D on Reddit aren't good, but this
time there is an almost decent comparison between D and Rust:
http://www.reddit.com/r/programming/comments/10k9ao/why_i_think_rust_is_the_language_of_the_future/
I think the most direct competitor of D is going to become Rust
On Thursday, 27 September 2012 at 19:57:13 UTC, Andrei
Alexandrescu wrote:
So I think in order to enable true dynamic loading, I'll need
to generate PIC for druntime and phobos, and then link
liblib.so like this:
dmd -fPIC -c lib.d
gcc -shared lib.o -o liblib.so -L/path/to/phobos -lphobos2
On Friday, September 28, 2012 03:43:13 Andrej Mitrovic wrote:
So I just had a bug I thought I'd never have: dpaste.dzfl.pl/5c0ab8b8
It's pretty obvious what's going on from that code snippet. But in a
larger codebase where refactoring happens often it's easy to make a
mistake of leaving out
From the Reddit thread:
Walter:
D has the @safe annotation, which prevents unsafe pointer
operations.
Rust has a statically enforced borrow/lend management system, and
other things like memory regions, that make it smarter (and
probably harder to use).
The Rust type system extends what
On 9/28/12, Jonathan M Davis jmdavisp...@gmx.com wrote:
That would make the language whitespace-sensitive, which I would consider a
major no-no.
I don't know of any use-case where you actually want to use such an if
statement. Would you ever allow this to pass a human code-review?:
if (bVal)
On Friday, September 28, 2012 04:12:46 Andrej Mitrovic wrote:
This is a very specific situation that could be handled unless it is
too complex to mess with the lexer. If there's an if statement which
isn't followed by a block but is followed by a blank line emit a
warning. Sounds simple enough
On Friday, 28 September 2012 at 02:12:20 UTC, Andrej Mitrovic
wrote:
This is a very specific situation that could be handled unless
it is
too complex to mess with the lexer. If there's an if statement
which
isn't followed by a block but is followed by a blank line emit a
warning. Sounds simple
What is the D-way to implement fsm with code generation?
you might have a look at ragel:
http://www.complang.org/ragel/
On 20/09/12 18:57, Jonathan M Davis wrote:
On Thursday, September 20, 2012 18:35:21 bearophile wrote:
monarch_dodra:
It's not, it only *operates* on ASCII, but non ascii is still a
legal arg:
Then maybe std.ascii.toLower needs a pre-condition that
constraints it to just ASCII inputs, so
27.09.2012 14:48, Mirko Pilger пишет:
What is the D-way to implement fsm with code generation?
you might have a look at ragel:
http://www.complang.org/ragel/
I had. It's good but is too fat for my purpose - simple fsm
implementation in D without third party's instruments (for simple use).
On Thu, Sep 27, 2012 at 10:15 AM, Druzhinin Alexandr
n...@digitalmars.com wrote:
27.09.2012 14:48, Mirko Pilger пишет:
What is the D-way to implement fsm with code generation?
I'm not sure you need code generation. Using D functions literals or
closures already gives you a good part of a FSM:
What is the correct use of scope as storage class?
int counter;
void foo(scope int a) {
counter = a;
}
void main() {
int num = 42;
foo(num);
}
My handy has send to soon
This code:
int counter;
void foo(scope int a) {
counter = a;
}
void main() {
int num = 42;
foo(num);
}
works fine but I think it should not. So can you explain me the
use of scope as a storage class?
Namespace:
int counter;
void foo(scope int a) {
counter = a;
}
void main() {
int num = 42;
foo(num);
}
works fine but I think it should not. So can you explain me the
use of scope as a storage class?
Generally such enforcement is not (well) implemented in the dmd
front-end
So you mean this code should give an error?
import std.stdio;
class A { }
A ga;
void foo(scope A a) {
ga = a;
}
void main() {
A a = new A();
foo(a);
}
On Thu, 27 Sep 2012 08:03:39 -0400, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Wed, 26 Sep 2012 02:16:31 -0400, Jacob Carlborg d...@me.com wrote:
On 2012-09-26 07:37, Sean Kelly wrote:
A shared static dtor?
Didn't think of that. When exactly are those run?
On Wed, 26 Sep 2012 02:16:31 -0400, Jacob Carlborg d...@me.com wrote:
On 2012-09-26 07:37, Sean Kelly wrote:
A shared static dtor?
Didn't think of that. When exactly are those run?
https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dmain2.d#L319
-Steve
On Sunday, 10 June 2012 at 10:16:23 UTC, jerro wrote:
No, but you could wrap it in a template to force it to always
execute at compile time.
So, I just realized, I could have just this one convenience
template that I can use whenever I want to force an expression to
be evaluated at
27.09.2012 18:15, Philippe Sigaud пишет:
I'm not sure you need code generation. Using D functions literals or
closures already gives you a good part of a FSM:
States are functions, that accept a current 'payload' and return a
tuple consisting of another function and the new payload.
The
Tommi:
2) Is it possible to specialize a function based on whether or
not the parameter that was passed in is a compile time constant?
I am interested in this since some years. I think it's useful,
but I don't know if it can be implemented. I don't remember
people discussing about this
Is there any difference between these two code snippets:
#1:
struct Foo(T : Object) {
#2:
struct Foo(T) if (is(T == class)) {
?
I ask because I prefer option #1, but I see most often in Phobos
variant #2.
On 09/27/2012 03:01 PM, Namespace wrote:
Is there any difference between these two code snippets:
#1:
struct Foo(T : Object) {
#2:
struct Foo(T) if (is(T == class)) {
?
I ask because I prefer option #1, but I see most often in Phobos variant
#2.
Yes there is:
struct S{
Object o;
1 - 100 of 128 matches
Mail list logo