since i am converting from c# to d :
1. how to check template inheritance
c# code
interface I
class A : I { void run(){}}
class B : A {}
void D\ (T t) : where T:B, new T()
{
t.run();
}
d code
//there should be has several check such as hasBase,
hasImplements on std.traits
void D(T) (int a) if
On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote:
since i am converting from c# to d :
2. how to make built in array , std.container.slist,
container.HashMap (emsi_containers) a range
c# code
void a(IEnumerable\ a) {}
dcode
void a(InputRange!string a) {}
// notworking : i slice it to
On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote:
3. known OAuth / OIDC Api Sdk in D.
there is only Jwt stuff when search code.dlang.org.
https://code.dlang.org/packages/oauth
https://code.dlang.org/packages/vibe-auth
On Monday, 14 September 2020 at 16:44:14 UTC, Adam D. Ruppe wrote:
This is a common mistake with people coming from C++. A D class
is more like a Java class - it is automatically a reference.
So your class Bob here in D would actually be represented as
`Bob*` in C++.
Thus when you define `B
On Monday, 14 September 2020 at 16:29:11 UTC, Fitz wrote:
I expect the following code below to create 10 items with 10
different addresses, instead they all have the same address?
You are taking the address of the local variable holding
reference, not the reference itself.
class Bob {
}
Bo
I expect the following code below to create 10 items with 10
different addresses, instead they all have the same address?
import std.stdio;
class Bob {
}
void main()
{
for (auto i = 0; i < 10; i++) {
auto pBob = bobFactory();
writefln("bob @ %x\n", pBob);
}
}
Bob *bobF
On Sunday, 22 November 2015 at 09:55:10 UTC, fred wrote:
How to generate temporary files so compilation time speeds up.
Normal compilation only produce obj, exe.
If what i mean is that if we compile the files that unchanged,
dmd will look for that temporary files instead of .d files.
The .d
On Sunday, 22 November 2015 at 09:41:42 UTC, fred wrote:
So why most d library still static link.
It generally results in smaller and faster distributions and less
hassle for the typical D use case today.
How to generate temporary files so compilation time speeds up.
Normal compilation only produce obj, exe.
If what i mean is that if we compile the files that unchanged,
dmd will look for that temporary files instead of .d files.
Hi.
Dll or shared library is important feature of software
development.
So why most d library still static link.
I am sorry for my stupid question.
Thanks.
On Mon, 12 May 2014 20:12:41 +
Kai via Digitalmars-d-learn wrote:
> Hi I am trying to iterate over a mmfile (ubyte[]) and convert it
> to uint
>
> void main(){
> MmFile inn = new MmFile("mmData.dat");
> ubyte[] arr = cast(ubyte[])inn[];
> for(ulong index = 0; index ulong stop = in
Hi I am trying to iterate over a mmfile (ubyte[]) and convert it
to uint
void main(){
MmFile inn = new MmFile("mmData.dat");
ubyte[] arr = cast(ubyte[])inn[];
for(ulong index = 0; indexError: template std.bitmanip.littleEndianToNative cannot deduce
function from argument
On 5/6/2014 8:29 PM, Oleg wrote:
QUESTION: How to define the dfuse library version of I'm doing it wrong
way?
I believe you might find this thread[1] in the dub forum helpful.
[1]
http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub/thread/1328/
On 5/7/2014 10:41 PM, Mike Parker wrote:
On 5/6/2014 8:29 PM, Oleg wrote:
QUESTION: How to define the dfuse library version of I'm doing it wrong
way?
I believe you might find this thread[1] in the dub forum helpful.
Sorry, wrong link. It should be:
http://forum.rejectedsoftware.com/groups
Hello.
I'm developing library and want to add an examples to the same
project. If I understand corecly, DUB allows to build a
dependencies from another folder and use them to build a program.
I've tried two ways - subConfigurations and subPackages. For
example, there is subConfigurations confi
On Tuesday, 19 November 2013 at 22:05:36 UTC, Jacek Furmankiewicz
wrote:
is there any particular reason you are forced to use SOAP?
It is more or less an obsolete and generally frowned upon
approach.
if you were willing to adopt REST, vibe.d seems to have some
nice functionality for creating
is there any particular reason you are forced to use SOAP?
It is more or less an obsolete and generally frowned upon
approach.
if you were willing to adopt REST, vibe.d seems to have some nice
functionality for creating REST APIs.
Look at the 'Routing' section here:
http://vibed.org/docs#h
On Tuesday, 19 November 2013 at 20:38:00 UTC, Adam D. Ruppe wrote:
On Monday, 18 November 2013 at 23:49:56 UTC, Rick Catano wrote:
My first question of the D language is, is there a SOAP module
that I can consume web services with?
I don't know, but I don't think so. Maybe it wouldn't be too
On Monday, 18 November 2013 at 23:49:56 UTC, Rick Catano wrote:
My first question of the D language is, is there a SOAP module
that I can consume web services with?
I don't know, but I don't think so. Maybe it wouldn't be too hard
to make out by combining http get (with curl or whatever) with
Anyone? I know it's a very basic question, but an honest and
friendly answer will suffice.
Hello all,
I'm new here ( first post ), and looking to get into D
Development. I currently use Python as my language of choice, but
am looking to transition. My first question of the D language is,
is there a SOAP module that I can consume web services with?
On Thu, Dec 22, 2011 at 16:45, clk wrote:
> Philippe,
> I don't understand the example below to simulate the list comprehension
> syntax. Are input1, input2 and input3 ranges?
Yes, inputs are ranges. Sorry, I was perhaps a bit hasty in answering.
The code is on github:
https://github.com/Philip
On Thu, Dec 22, 2011 at 16:37, clk wrote:
> Philippe,
> Thank you very much for your response. It looks similar to what I've done
> in javascript by wrapping all function arguments into a single object
> literal but the D alternative you propose is a little to convoluted for a
> beginner like me.
;a*a+b*b == c*c&& a
--
Message: 2
Date: Tue, 20 Dec 2011 21:45:26 +0100
From: Philippe Sigaud
To: "digitalmars.D.learn"
Subject: Re: newbie question: Can D do this?
Message-ID:
Content-Type: text/plain; charset=UTF-8
On Mon, Dec 19, 2011 at 17:17, clk wrote:
Correct. As oth
Philippe,
Thank you very much for your response. It looks similar to what I've
done in javascript by wrapping all function arguments into a single
object literal but the D alternative you propose is a little to
convoluted for a beginner like me. Perhaps I'll understand it better
after I'm don
Timon Gehr , dans le message (digitalmars.D.learn:31142), a écrit :
> On 12/20/2011 03:18 PM, clk wrote:
>> Thank you for your quick replies. I'm impressed by the helpfulness and
>> dedication of the D community!
>> Here's another one. Is there a way to pass arguments to functions by
>> keyword as
In PHP frameworks often use $option arrays which are some kind of key
value pairs. they are merged with the default valuzes inside the function.
pro:
- you can pass an argument by name
- you only need to pass those who needed.
cons:
- hash arrays
it should be possible to create a similar meth
On 20/12/2011 20:36, Philippe Sigaud wrote:
That is, it expects some values, then string/values couples as
associative arrays.
I've a recollection of seeing something like this in the PHP library, but I forget where.
I believe it's used in some functions that have a lot of options to set, s
On Mon, Dec 19, 2011 at 17:17, clk wrote:
> 2) D doesn't seem to support the list comprehension syntax available in
> python and javascript. Is this correct?
>
> [f(x) for x in list if condition]
Correct. As other have said, it's doable by combining std functions.
As fas as I know, we do not h
> On 20/12/2011 14:18, clk wrote:
>> Here's another one. Is there a way to pass arguments to functions by
>> keyword as in the
>> calls to f and g below?
I remember a discussion about year ago or so.
It seems doable to have some kind of function transformer (adaptor?) for this.
from:
int foo(in
On Tue, 20 Dec 2011 09:18:16 -0500, clk wrote:
Thank you for your quick replies. I'm impressed by the helpfulness and
dedication of the D community!
Here's another one. Is there a way to pass arguments to functions by
keyword as in the calls to f and g below?
void f(int a = 0, int b = 1) {}
v
igitalmars-d-learn digest..."
Today's Topics:
1. Re: newbie question: Can D do this? (Ali ?ehreli)
2. Re: newbie question: Can D do this? (Kai Meyer)
3. Re: newbie question: Can D do this? (Simen Kj?r?s)
4. Re: newbie question: Can D do this? (Ali ?ehreli)
5. Re: newbie questio
c.com
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Digitalmars-d-learn digest..."
Today's Topics:
1. Re: newbie question: Can D do this? (Ali ?ehreli)
2. Re: newbie question: Can D do this? (Kai Meyer)
3. Re: newbie question: Can
On Monday, 19 December 2011 at 19:01:10 UTC, Simen Kjærås wrote:
import std.typetuple : TypeTuple;
import std.typecons : tuple;
TypeTuple!(a, b) = tuple(b,a);
There is a pull request implementing multiple variable
declarations:
https://github.com/D-Programming-Language/dmd/pull/341
However,
On Monday, December 19, 2011 11:07:49 Ali Çehreli wrote:
> That's a great article.[1] I hope that this chapter is more
> beginner-friendly:
>
> http://ddili.org/ders/d.en/ranges.html
Cool. One of the things that we're missing on the website is a solid article
on ranges (I started such an article
On 12/19/2011 10:39 AM, Jonathan M Davis wrote:
> it's a range (see
> http://www.informit.com/articles/printerfriendly.aspx?p=1407357 for a
general
> explanation of the concept of ranges)
That's a great article.[1] I hope that this chapter is more
beginner-friendly:
http://ddili.org/ders/d
On Mon, 19 Dec 2011 17:17:43 +0100, clk wrote:
Hello,
I'm new to this mailing list. I'm trying to learn D to eventually use
it in production code.
I'm a little bit intimidated by the fact that the topics in the d-learn
list look rather advanced to a newbie like me.
I have 3 fairly simple ques
On 12/19/2011 09:17 AM, clk wrote:
Hello,
I'm new to this mailing list. I'm trying to learn D to eventually use it
in production code.
I'm a little bit intimidated by the fact that the topics in the d-learn
list look rather advanced to a newbie like me.
I have 3 fairly simple questions:
1) Does
On 12/19/2011 08:17 AM, clk wrote:
> I'm a little bit intimidated by the fact that the topics in the d-learn
> list look rather advanced to a newbie like me.
We need more newbie topics here! :)
> 1) Does D support something like the javascript 1.8 destructuring
> assigment (multiple assigment i
On Monday, December 19, 2011 11:17:43 clk wrote:
> Hello,
> I'm new to this mailing list. I'm trying to learn D to eventually use
> it in production code.
> I'm a little bit intimidated by the fact that the topics in the d-learn
> list look rather advanced to a newbie like me.
> I have 3 fairly sim
On 19.12.2011 17:17, clk wrote:
1) Does D support something like the javascript 1.8 destructuring
assigment (multiple assigment in python):
[a, b] = [b, a];
I don't think so, but you can do something like this with templates:
void swap(alias a, alias b)() {
auto t = a;
a = b;
b = t
Hello,
I'm new to this mailing list. I'm trying to learn D to eventually use
it in production code.
I'm a little bit intimidated by the fact that the topics in the d-learn
list look rather advanced to a newbie like me.
I have 3 fairly simple questions:
1) Does D support something like the ja
Timon Gehr:
> As to
> source-level compatibility, the only "guarantee" that Ds design gives is
> that C code will either compile as D code with identical semantics or
> not compile at all.
In practice there are few differences, try to compile this in C and D, swapping
the import/include:
imp
On 09/18/2011 10:08 PM, %u wrote:
does D compatibility with C restrict D from evolving ?
Binary compatibility as in extern(C) certainly does not. As to
source-level compatibility, the only "guarantee" that Ds design gives is
that C code will either compile as D code with identical semantics o
does D compatibility with C restrict D from evolving ?
and if D drop this will that prevent complexity?
std.algorithm!
will have a look, thanks!
"bearophile" wrote in message news:isb5ql$1i23$1...@digitalmars.com...
Lloyd Dupont:
I did the following, what do you think of my implementation?
Those for loops seem better as foreach ones, or even reverse foreach ones.
Probably in std.algorithm t
On 2011-06-03 09:55, Lloyd Dupont wrote:
> I did the following, what do you think of my implementation?
> (checking if my string and array usage could be improved / powered
> up!!!)
>
> string[] _locales = ["en-AU", "fr-FR"];
> string getCurrentLocal() { return "fr-BE"; }
> string[] getCandida
Lloyd Dupont:
> I did the following, what do you think of my implementation?
Those for loops seem better as foreach ones, or even reverse foreach ones.
Probably in std.algorithm there is stuff to shorten your code.
Bye,
bearophile
I did the following, what do you think of my implementation?
(checking if my string and array usage could be improved / powered
up!!!)
string[] _locales = ["en-AU", "fr-FR"];
string getCurrentLocal() { return "fr-BE"; }
string[] getCandidates()
{
auto local = getCurrentLocal();
strin
maybe it's late, or I have a hard time reading the string and array class
methods.. (which I have! :~)
anyway, I have a very simple problem and it seems hard to fix!
let say I have a list of resource named preferential order (favored first)
and I'd like to do return a list of match in preferent
Thu, 12 Mar 2009 17:12:41 -0400, Patrick Kristiansen wrote:
> The compiler fails with the following error:
>
> setwallp.obj(setwallp)
> Error 42: Symbol Undefined _coinitial...@4
> --- errorlevel 1
The implib doesn't produce acceptable results for Windows system DLLs.
It does cre
jicman Wrote:
> Patrick Kristiansen Wrote:
>
> > Hi
> >
> > I've been trying out D lately, and I really love it. I use the Tango
> > library at the moment, and I wanted to do some simple COM programming,
> > which I'm also a newbie at, just to get more acquainted with Windows
> > programming
Patrick Kristiansen Wrote:
> Hi
>
> I've been trying out D lately, and I really love it. I use the Tango library
> at the moment, and I wanted to do some simple COM programming, which I'm also
> a newbie at, just to get more acquainted with Windows programming in D.
>
> What I want to do is re
On Thu, 12 Mar 2009 00:31:33 +0300, Patrick Kristiansen
wrote:
Hi
I've been trying out D lately, and I really love it. I use the Tango
library at the moment, and I wanted to do some simple COM programming,
which I'm also a newbie at, just to get more acquainted with Windows
programming
Patrick Kristiansen wrote:
> ...
>
> Now, this is probably obvious to some people - but not to me. Why doesn't
> this work? Why does OPTLINK fail and tell me that the format of the .lib file
> is wrong? Is it because Digital Mars compilers produce .lib files in a
> different format? Is it bec
On Wed, Mar 11, 2009 at 5:31 PM, Patrick Kristiansen
wrote:
> Apparently, one of the first things to do is call CoInitialize(...), and
> this is where my problem arises.
That's funny, I've never had to call it when using DirectX interfaces.
Maybe it's something peculiar to DirectX?
> CoInitia
Hi
I've been trying out D lately, and I really love it. I use the Tango library at
the moment, and I wanted to do some simple COM programming, which I'm also a
newbie at, just to get more acquainted with Windows programming in D.
What I want to do is relatively simple I think. I want to use the
57 matches
Mail list logo