> On 03/28/2014 08:00 PM, H. S. Teoh wrote:
> >Today I ran into an interesting situation where I have a function f
> >that needs to return ranges of different types (but identical element
> >types):
> >
> > auto f(A...)(A args) {
> > ...
> > if (someCondition)
> >
On Saturday, 29 March 2014 at 21:30:03 UTC, CJS wrote:
Well, you can write one. You can also let D generate that list:
__traits(allMembers, some_c_module) gives you all symbols in
some_c_module.
[...]
I don't understand how that is possible. The C code I have
available is a compiled library and
Well, you can write one. You can also let D generate that list:
__traits(allMembers, some_c_module) gives you all symbols in
some_c_module.
Iterate over them, generate alias declarations, mix those
declarations in.
I don't understand how that is possible. The C code I have
available is a comp
On Friday, 28 March 2014 at 21:10:39 UTC, Ali Çehreli wrote:
On 03/28/2014 12:03 PM, "Marc Schütz" " wrote:
> destruction happens in reverse lexical order of declaration,
> and arrays are destroyed from back to front.
>
> Is this behaviour guaranteed?
It must be that way because later objects c
On Saturday, 29 March 2014 at 19:25:37 UTC, CJS wrote:
When you say define them in bulk at compile time, is there some
convenient way to just give an array of actions and iterate
over them to generate such statements? So that the only work
that needs to be updated to add/remove actions is updat
CJS:
When you say define them in bulk at compile time, is there some
convenient way to just give an array of actions and iterate
over them to generate such statements? So that the only work
that needs to be updated to add/remove actions is updating that
list?
You also need extern(C). So the
On Saturday, 29 March 2014 at 19:16:34 UTC, bearophile wrote:
alias context = action;
Sorry, I meant:
alias action = action;
Bye,
bearophile
When you say define them in bulk at compile time, is there some
convenient way to just give an array of actions and iterate over
them to gen
On 03/29/14 20:01, CJS wrote:
> I've been using a medium-sized C library. Most of the library calls look
> something like
>
> action(context, arg1, arg2)
>
> Where is the name of the library, action is the action to take, and
> context is an opaque pointer defined by the library to kee
CJS:
I've been using a medium-sized C library. Most of the library
calls look something like
action(context, arg1, arg2)
Where is the name of the library, action is the action to
take, and context is an opaque pointer defined by the library
to keep all the state related to these ac
alias context = action;
Sorry, I meant:
alias action = action;
Bye,
bearophile
I've been using a medium-sized C library. Most of the library
calls look something like
action(context, arg1, arg2)
Where is the name of the library, action is the action to
take, and context is an opaque pointer defined by the library to
keep all the state related to these actions.
On 03/29/14 18:30, Timon Gehr wrote:
>
> I'm stuck with 2.060 myself, but there's always http://dpaste.dzfl.pl/.
For the examples, I used a gdc that claims __VERSION__==2062L.
(for /real/ code I'm still using a 2.057 based one...)
artur
On 03/29/2014 06:19 PM, Artur Skawina wrote:
Of course it compiles -- with the compiler version I happen to use...
The compiler situation is one of the main reasons I gave up on D
about a year ago. Every release introduces a new dialect. This may
not be such a big problem for trivial toy program
On 03/29/14 16:31, Timon Gehr wrote:
> On 03/29/2014 01:37 AM, Artur Skawina wrote:
>> You can wrap the range in a common one. When the above approach isn't
>> enough, there's always the next level:
>
> (Note that your code does not actually compile.)
Of course it compiles -- with the compiler ve
On 03/29/2014 01:37 AM, Artur Skawina wrote:
You can wrap the range in a common one. When the above approach isn't
enough, there's always the next level:
(Note that your code does not actually compile.)
On 03/28/2014 08:00 PM, H. S. Teoh wrote:
Today I ran into an interesting situation where I have a function f that
needs to return ranges of different types (but identical element types):
auto f(A...)(A args) {
...
if (someCondition)
I want to use a set of functions that rely on a library which is
not available for D (Harfbuzz). So I just wrote myself a set a
functions that will do anything I need (Init, Free, Fonts, Text,
etc).
The DLL is working fine and dynamically linking should work (it
does in C++ --> LoadLibrary).
extern (C) /// needed so the compiler can link the functions
{
void Test();
}
The function of course is called "Test1" not Test.
18 matches
Mail list logo