Re: Howto use an alternative Linker with DUB?

2014-11-16 Thread Mike Parker via Digitalmars-d-learn

On 11/16/2014 6:46 AM, univacc wrote:

Hi,

I am sitting in front of this problems for hours now and I need help:
I need the a linker that is capable of delayed DLL loading and
apparently, OPTLINK does not provide this option.

unilink and Microsofts incremental linker support it so I would like to
use one of them but I cannot manage to get it to work.. :/

When I try to replace the OPTLINK Linker with set LINKCMD=... then dub
still tries to use the default argument list from OPTLINK, that
obviously does not work with other Linkers.

So what am I doing wrong


When compiling a 32-bit executable with DMD on Windows, you get OPTLINK 
by default. This has nothing to do with dub. You can use the MS linker 
by compiling a 64-bit exe (-m64), provided you have it installed and DMD 
is properly configured to use it. Also, I've read somewhere on here 
about support for the MS linker in 32-bit DMD with a special flag 
(-ms32coff IIRC), but I'm not sure if it's in the latest beta or what. A 
search of the newsgroup should turn something up for you if someone else 
doesn't give you the right answer first.




Re: Mixed Language Programming - e**x crashes

2014-11-16 Thread Kagamin via Digitalmars-d-learn
Well, the easiest thing is to see assembler generated at both 
sides and check if they are compatible. If they are not, try to 
interface via C ABI. You can also inspect value of X before 
calling EXP.


Operating on a Variadic Function Parameter Set

2014-11-16 Thread Nordlöw

If I have a variadic function such as in

haystack.find(needles)

what options do I have for defining needles in compile-time 
outside of this expression and call find() with this definition 
as arguments possibly multiple-times?


Is std.typecons.Tuple my only option here?

Further, is it possible to operate on this parameter set in 
compile-time such as in my case reversing all the arguments 
before feeding them as a variadic set of function parameters?


I need this in my module

https://github.com/nordlow/justd/blob/master/skip_ex.d#L122

when implementing skipOverBackShortestOf who needs to call retro 
on each of the needles.


Re: Operating on a Variadic Function Parameter Set

2014-11-16 Thread Nordlöw

On Sunday, 16 November 2014 at 11:40:16 UTC, Nordlöw wrote:

If I have a variadic function such as in

haystack.find(needles)

what options do I have for defining needles in compile-time 
outside of this expression and call find() with this definition 
as arguments possibly multiple-times?


I just found out that Tuple member expand does what I want here.


Re: Precise TLS GC

2014-11-16 Thread Etienne via Digitalmars-d-learn

I realize this shouldn't belong in D.learn :)

http://forum.dlang.org/thread/m4aahr$25qd$2...@digitalmars.com#post-m4aahr:2425qd:242:40digitalmars.com


Precise TLS GC

2014-11-16 Thread Etienne via Digitalmars-d-learn
I always wondered why we would use the shared keyword on GC allocations 
if only the stack can be optimized for TLS Storage.


After thinking about how shared objects should work with the GC, it's 
become obvious that the GC should be optimized for local data. Anything 
shared would have to be manually managed, because the biggest slowdown 
of all is stopping the world to facilitate concurrency.


With a precise GC on the way, it's become easy to filter out allocations 
from shared objects. Simply proxy them through malloc and get right of 
the locks. Make the GC thread-local, and you can expect it to scale with 
the number of processors.


Any thread-local data should already have to be duplicated into a shared 
object to be used from another thread, and the lifetime is easy to 
manage manually.


SomeTLS variable = new SomeTLS(Data);
shared SomeTLS variable2 = cast(shared) variable.dupShared();
Tid tid = spawn(doSomething, variable2);
variable = receive!variable2(tid).dupLocal();
delete variable2;

Programming with a syntax that makes use of shared objects, and forces 
manual management on those, seems to make stop the world a thing of 
the past. Any thoughts?


printing array of strings with writefln?

2014-11-16 Thread Artem Tarasov via Digitalmars-d-learn
writefln(%(%s-%), [a, b, c]) doesn't print the intended 
a-b-c but surrounds each string with double quotes - a-b-c, 
which I find inconsistent with the fact that writefln(%s, a 
string) prints the string without any quotes.

How do I get the desired behaviour using just the format string?


Re: Operating on a Variadic Function Parameter Set

2014-11-16 Thread Nordlöw

On Sunday, 16 November 2014 at 11:40:16 UTC, Nordlöw wrote:

If I have a variadic function such as in

haystack.find(needles)

what options do I have for defining needles in compile-time 
outside of this expression and call find() with this definition 
as arguments possibly multiple-times?


Is std.typecons.Tuple my only option here?

Further, is it possible to operate on this parameter set in 
compile-time such as in my case reversing all the arguments 
before feeding them as a variadic set of function parameters?


I need this in my module

https://github.com/nordlow/justd/blob/master/skip_ex.d#L122

when implementing skipOverBackShortestOf who needs to call 
retro on each of the needles.


I cracked skipOverBackShortestOf too at

https://github.com/nordlow/justd/blob/master/skip_ex.d#L133

:)


Re: printing array of strings with writefln?

2014-11-16 Thread JR via Digitalmars-d-learn

On Sunday, 16 November 2014 at 14:16:55 UTC, Artem Tarasov wrote:
writefln(%(%s-%), [a, b, c]) doesn't print the intended 
a-b-c but surrounds each string with double quotes - 
a-b-c, which I find inconsistent with the fact that 
writefln(%s, a string) prints the string without any quotes.

How do I get the desired behaviour using just the format string?


writefln(%-(%s-%), [a, b, c])

http://ddili.org/ders/d.en/formatted_output.html


Re: printing array of strings with writefln?

2014-11-16 Thread Artem Tarasov via Digitalmars-d-learn
Thanks! The Ali's book is indeed superb, covering even such minor 
details.


Kitchen Offers Reviews

2014-11-16 Thread ayoayo via Digitalmars-d-learn

Don’t know why more companies can’t be like kitchen offers that
offer a pay on delivery service. No need for big deposits.