On 06/23/2014 10:03 PM, David Zaragoza wrote:> Hello
>
> I'm trying to compile the following program:
>
> module main;
>
> int main(string[] argv){
> short asd = 1;
> short qwe = asd + asd;
> return 0;
> }
>
> And the compiler gives this error:
>
> C:\David>dmd simple
> simple.d(5):
Hello
I'm trying to compile the following program:
module main;
int main(string[] argv){
short asd = 1;
short qwe = asd + asd;
return 0;
}
And the compiler gives this error:
C:\David>dmd simple
simple.d(5): Error: cannot implicitly convert expression
(cast(int)asd + c
On 24/06/2014 1:13 p.m., Jason King wrote:
This is me trying to link with Juno and getting tantalizingly close to
success.
DMD home is d:\d so binaries are d:\d\dmd2\windows\bin (on path)
Juno is in
D:\dlang\Juno-Windows-Class-Library
D:\dlang\Juno-Windows-Class-Library\juno.lib exists
sc.ini is
So in Ruby and R and Scheme and... I have happily used map /
collect for years and years.
Lovely thing.
So I did the dumb obvious of
string[] stringList = map!...;
And D barfed, wrong type, some evil voldemort thing again.
So..
auto stringList = map!;
and we're good..
and happil
On Monday, 23 June 2014 at 09:09:56 UTC, hane wrote:
On Monday, 23 June 2014 at 08:30:44 UTC, h_zet wrote:
import std.typecons;
auto foo2(R)(R foopara){
return tuple(foopara, is(R==int));
}
void main(){
auto tuple(a,b) = foo2(1);
}
I'm expecting some error such as can not act as left v
This is me trying to link with Juno and getting tantalizingly
close to success.
DMD home is d:\d so binaries are d:\d\dmd2\windows\bin (on path)
Juno is in
D:\dlang\Juno-Windows-Class-Library
D:\dlang\Juno-Windows-Class-Library\juno.lib exists
sc.ini is untouched
D:\dlang\Juno-Windows-Class-Lib
Just an idea that popped into my head... Maybe I can use variant
for the input/output types? I haven't looked at it yet, so I'm
not sure what it does, or the performance costs.
I realized that because the final callback always gets called,
and the types of the intermediate steps may be differ
Just to be sure: whether or not an error is passed to a
callback, the
final callback is always called?
I mean, the last callback could also be called *only when
something
fails*, a bit like a default case in a switch, or an
error-handling
routine.
Yes, the final callback is always called, bu
On Monday, 23 June 2014 at 22:11:57 UTC, John Carter wrote:
On Monday, 23 June 2014 at 21:49:29 UTC, Ary Borenszweig wrote:
Union types are very common (I use them every day), and IMHO
it's very nice to have them included in the language (either
built-in or as a library solution). As a library
Ali, of course, is right. The only thing I'd add is for a
Windowsy programmer (unless you have cygwin installed) you
probably want something like "cmd.exe" instead of bash.
On Monday, 23 June 2014 at 21:49:29 UTC, Ary Borenszweig wrote:
Union types are very common (I use them every day), and IMHO
it's very nice to have them included in the language (either
built-in or as a library solution). As a library solution I
would do something like this:
Union!(int, stri
On Monday, 23 June 2014 at 21:26:19 UTC, Chris Williams wrote:
More likely what you want are variants:
Hmm. Interesting.
Yes, Variant and VariantArray are much closer to the dynamic
language semantics...
But the interesting thing is Tuple is much closer to "What I
Mean" when I create thes
Ary Borenszweig:
As a library solution I would do something like this:
Union!(int, string)[] elements;
elements ~= 1;
elements ~= "hello";
Take a look at Algebraic in Phobos.
Bye,
bearophile
On 6/23/14, 6:18 PM, John Carter wrote:
I guess between perl and Ruby and Scheme etc. I got used to creating
hybrid containers
Want a pair of [string, fileList]? Just make an Array with two items,
one a string, one and array of strings. Done.
D barfed... leaving me momentarily stunned... th
On Monday, 23 June 2014 at 21:18:39 UTC, John Carter wrote:
I guess between perl and Ruby and Scheme etc. I got used to
creating hybrid containers
Want a pair of [string, fileList]? Just make an Array with two
items, one a string, one and array of strings. Done.
D barfed... leaving me mo
I guess between perl and Ruby and Scheme etc. I got used to
creating hybrid containers
Want a pair of [string, fileList]? Just make an Array with two
items, one a string, one and array of strings. Done.
D barfed... leaving me momentarily stunned... then Oh Yes, type
safety, Tuple's are t
On Mon, Jun 23, 2014 at 9:39 PM, Christian Beaumont via
Digitalmars-d-learn wrote:
> Each function is given a callback, that when called, steps the waterfall
> forward on to the next function to process. If an error is passed to the
> callback (instead of null), then the waterfall stops processi
Hi,
I just started learning D, and thought I'd throw myself in at the
deep end with some meta-programming, trying to write the
equivalent of the commonly used, async waterfall, and also,
because I'd like to use it...
If you aren't familiar with it, waterfall is a function that is
passed a s
A lot of developers will say thanks if you help with developing
DGUI https://bitbucket.org/dgui/dgui/
D very need native and easy to use GUI lib...
On Mon, 23 Jun 2014 14:30:12 -0400, Ali Çehreli wrote:
On 06/22/2014 11:32 PM, FreeSlave wrote:> On Monday, 23 June 2014 at
01:16:49 UTC, Evan Davis wrote:
>> As the subject says, I would like to pass around an array of
>> functions. The trick is, that the functions have different type
>>
On 06/22/2014 11:32 PM, FreeSlave wrote:> On Monday, 23 June 2014 at
01:16:49 UTC, Evan Davis wrote:
>> As the subject says, I would like to pass around an array of
>> functions. The trick is, that the functions have different type
>> signatures. Is there a way to put the two functions
>>
>> int
On Sun, 22 Jun 2014 08:23:45 -0400, Uranuz wrote:
If these rules are not so clear and have some exceptions (but I don't
understand why they are needed) then some documentation needed about
this.
See integer promotion rules:
http://dlang.org/type.html#Integer%20Promotions
And the section
On Monday, 23 June 2014 at 16:43:31 UTC, Mike wrote:
I wish I could help with the development of D (either the
compiler or std library).
Is there a TODO list kept somewhere? Neither Phobos nor DMD
have an `issues` page on Github..
I found this http://wiki.dlang.org/Review_Queue but it's kind
On Mon, Jun 23, 2014 at 04:43:30PM +, Mike via Digitalmars-d-learn wrote:
> I wish I could help with the development of D (either the compiler or
> std library).
>
> Is there a TODO list kept somewhere? Neither Phobos nor DMD have an
> `issues` page on Github..
[...]
http://issues.dlang.org/
I wish I could help with the development of D (either the
compiler or std library).
Is there a TODO list kept somewhere? Neither Phobos nor DMD have
an `issues` page on Github..
I found this http://wiki.dlang.org/Review_Queue but it's kind of
short.
Best regards,
Mike
h_zet:
Why does this work? Or it is a bug?
When you play a little with this code it's easy to see _error_
that should not appear. So there's surely something worth
reporting as bug, but I don't yet know what.
Bye,
bearophile
On Monday, 23 June 2014 at 09:29:15 UTC, Mason McGill wrote:
Strange behavior, indeed. It took me a minute, but I think I
know what's going on, and I'm pretty sure it's a bug. D
recently introduced a short syntax for function-like templates:
enum a(b) = "some_value";
It looks like this also
On Monday, 23 June 2014 at 08:30:44 UTC, h_zet wrote:
import std.typecons;
auto foo2(R)(R foopara){
return tuple(foopara, is(R==int));
}
void main(){
auto tuple(a,b) = foo2(1);
}
I'm expecting some error such as can not act as left value but
when I compiled this, no error occured. DM
On Monday, 23 June 2014 at 08:30:44 UTC, h_zet wrote:
import std.typecons;
auto foo2(R)(R foopara){
return tuple(foopara, is(R==int));
}
void main(){
auto tuple(a,b) = foo2(1);
}
I'm expecting some error such as can not act as left value but
when I compiled this, no error occured. DM
On Monday, 23 June 2014 at 08:30:44 UTC, h_zet wrote:
import std.typecons;
auto foo2(R)(R foopara){
return tuple(foopara, is(R==int));
}
void main(){
auto tuple(a,b) = foo2(1);
}
I'm expecting some error such as can not act as left value but
when I compiled this, no error occured. DM
import std.typecons;
auto foo2(R)(R foopara){
return tuple(foopara, is(R==int));
}
void main(){
auto tuple(a,b) = foo2(1);
}
I'm expecting some error such as can not act as left value but
when I compiled this, no error occured. DMD version is DMD64
v2.065.(ldc2 exited with error func
On 23/06/2014 8:19 AM, Bienlein wrote:
On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote:
As the subject says, I would like to pass around an array of
functions. The trick is, that the functions have different type
signatures. Is there a way to put the two functions
int foo(int a, int b
My dub.json :
```
{
"name": "ddb_test",
"description": "A minimal D application.",
"dependencies": {
"gtk-d:gtkd": ">=2.3.3",
"ddb": ">=0.2.1"
}
}
```
My source (source/app.d):
```
import ddb.postgres;
import gtk.Window;
int main(string[] argv) {
return 0;
}
```
On Monday, 23 June 2014 at 01:16:49 UTC, Evan Davis wrote:
As the subject says, I would like to pass around an array of
functions. The trick is, that the functions have different type
signatures. Is there a way to put the two functions
int foo(int a, int b);
bool bar(bool a, bool b);
into one
34 matches
Mail list logo