On Monday, 26 January 2015 at 11:15:26 UTC, Joakim wrote:
Right now, any attempt to have symbols with the same name
errors out, regardless of how they're used. This caused a
problem for me because I'm trying to use a third-party C
library that defines a struct type called "socket" and my code
On Wednesday, 28 January 2015 at 11:50:46 UTC, Danny wrote:
Hello,
I'm trying to write some toy examples using threads in D.
Is the std.stdio.File thread-local or shared? Is flockfile used
when I synchronize on it?
I tried checking phobos myself and found some things I don't
get (in stdio.d
I think I have to set "length" first.
Yes.
Declaring
BitArray b;
is like declaring
int[] a; // ={.length = 0, . ptr = null}
you get the segfault for invalid dereference.
On Saturday, 31 January 2015 at 14:12:59 UTC, Phil wrote:
When trying to run my program with profiling enabled it dies
before the first line of my main function runs. Everything
works fine without profiling. I get the following stack trace:
thread #1: tid = 0x38de4, 0x00010008d985
vision
On Thursday, 5 February 2015 at 12:31:31 UTC, Stéphane wrote:
Syntax for checking if an element exists in a list
Hello,
I would like to know if there is a better (easier to wite,
easier to read, easier to understand) way to check if an element
(string) is
in a list of strings.
Here are t
On Thursday, 5 February 2015 at 13:31:21 UTC, Nicholas Wilson
wrote:
On Thursday, 5 February 2015 at 12:31:31 UTC, Stéphane wrote:
Syntax for checking if an element exists in a list
Hello,
I would like to know if there is a better (easier to wite,
easier to read, easier to understand) way to
On Friday, 6 February 2015 at 17:09:29 UTC, Charles wrote:
I'm trying to create a template function that can take in any
type of array and convert it to a ubyte array. I'm not
concerned with endianness at the moment, but I ran into a
roadblock when trying to do this with strings. It already wor
The original code I was using was written in Java, and only had
a method for strings. This is closer to what I wanted. My unit
tests were just going back and forth with readString function,
so I was completely missing this for other types. Nice catch!
There were a couple issues with your cod
On Monday, 9 February 2015 at 19:30:32 UTC, Benjamin Thaut wrote:
When binding C++ value types you might want to use them by
placing them on the D-Stack. This however seems to be not
supported as the mangling for the constructor is completely
wrong. Is this supposed to work?
Kind Regards
Benj
On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:
Also I can't get my application to load images that I place in
the Resources folder(or any folder in the bundle for that
matter).
I suggest to have a look at the projects generated by SFML
regarding locating the resources in C++/ObjC and t
On Friday, 20 February 2015 at 06:19:29 UTC, Gan wrote:
On Friday, 20 February 2015 at 06:10:51 UTC, Nicholas Wilson
wrote:
On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:
Also I can't get my application to load images that I place
in the Resources folder(or any folder in the bundle for
On Saturday, 28 February 2015 at 06:45:58 UTC, Mike Parker wrote:
I'm not a Mac user and I'm fairly clueless about it. The DMD
zip for OS X contains one executable. I assume it's a 64-bit
binary. Is that true?
Most likely a disk image (.dmg).
(en.wikipedia.org/wiki/Apple_Disk_Image)
On Thursday, 2 April 2015 at 23:12:25 UTC, biozic wrote:
The code below doesn't compile. Why this error message?
---
struct Item {
int i;
}
struct Params {
Item* item;
this(int i) {
item = new Item(i); // line 9
}
}
struct Foo(Params params) {}
enum foo = Foo!(Params(
On Sunday, 7 June 2015 at 12:42:12 UTC, Nicholas Wilson wrote:
On Sunday, 7 June 2015 at 12:30:12 UTC, Dennis Ritchie wrote:
Does D the ability to add items to arrays and hashes at
compile time?
For example, how do I do it in compile time?:
int[][int][int] hash;
hash[4][6] ~= [34, 65];
hash[
On Sunday, 7 June 2015 at 12:30:12 UTC, Dennis Ritchie wrote:
Does D the ability to add items to arrays and hashes at compile
time?
For example, how do I do it in compile time?:
int[][int][int] hash;
hash[4][6] ~= [34, 65];
hash[5][7] ~= [4, 78, 21];
try using a pure function + static e.g.
On Sunday, 7 June 2015 at 00:38:17 UTC, Jonathan Villa wrote:
module dt2.DataBlock;
class DataBlock
{
public DataBlock * NextBlock;
public DataBlock * PrevBlock;
public string value;
this()
{
NextBlock = null;
PrevBlock =
How do I iterate through an AA sorted by key?
I am unable to .dup the aa.byKeyValue().
I have tried both
foreach(e; aa.byKeyValue().sort!"a.key < b.key")
{
//... use e. key && e.value
}
and
foreach(k,v; aa.byKeyValue().sort!"a.key < b.key")
{
}
i get :
template std.algorithm.sorting.sort
On Saturday, 27 June 2015 at 12:27:59 UTC, H. S. Teoh wrote:
On Sat, Jun 27, 2015 at 12:22:06PM +, Nicholas Wilson via
Digitalmars-d-learn wrote:
How do I iterate through an AA sorted by key?
I am unable to .dup the aa.byKeyValue().
Because it is a range, not an array.
To turn it into
On Monday, 29 June 2015 at 22:05:47 UTC, qznc wrote:
I stumbled upon this interesting programming challenge [0],
which imho should be possible to implement in D. Maybe someone
here wants to try.
Task: Given two enums with less than 256 states, pack them into
one byte and provide convenient ac
On Wednesday, 1 July 2015 at 08:33:44 UTC, Yuxuan Shui wrote:
On Wednesday, 1 July 2015 at 08:30:23 UTC, Yuxuan Shui wrote:
How do I express a mutable reference to a const object in D?
What I want to do is to define a variable, which refers a
constant object, but I can change which constant ob
So test.d depends on libgmp.a
Unsurprisingly:
$dmd test.d
fails to find libgmp.a
So tell it to look
$dmd -L-lgmp test.d
finds the wrong one or doesn't find it.
Tell it where to look
$dmd -L-L/usr/local/lib -L-lgmp test.d
Ok. Now it fails to find Phobos. Ok
$dmd -L-L/usr/local/lib -L-L/us
On Thursday, 2 July 2015 at 03:07:43 UTC, Matthew Gamble wrote:
I am trying to make the transition from C++ to D. I've hit a
snag with the etc.c.zlib module where any attempt to use this
module to open a file yields an error:
Error 42: Symbol Undefined __lseeki64.
Here is a simple example of c
On Thursday, 2 July 2015 at 12:19:06 UTC, Steven Schveighoffer
wrote:
On 7/2/15 8:10 AM, Nicholas Wilson wrote:
[...]
Try dmd -v, it will tell you the link line. Then you can try it
yourself to see how to get it to work. I know dmd has problems
with link line parameters, because it always pu
On Friday, 3 July 2015 at 23:45:15 UTC, Guy Gervais wrote:
On Friday, 3 July 2015 at 19:17:28 UTC, Marko Grdinic wrote:
Any advice regarding how I can get this to work? Thanks.
I got GDC to work with VS2013 + VisualD by going into
"Tools->Options" (The VS menu, not the one under "Visual D")
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
Hi,
I have a struct with arithmetic operations defined using
opBinary but array operations with arrays of it don't work.
struct Vector3 {
public double[3] _p;
...
Vector3 opBinary(string op)(in Vector3 rhs) const
if (op == "+
On Monday, 6 July 2015 at 03:02:59 UTC, Nicholas Wilson wrote:
On Monday, 6 July 2015 at 01:16:54 UTC, Peter wrote:
Hi,
I have a struct with arithmetic operations defined using
opBinary but array operations with arrays of it don't work.
struct Vector3 {
public double[3] _p;
...
Ve
On Friday, 17 July 2015 at 12:18:56 UTC, TC wrote:
Hello,
I came around a strange behavior and I'm not sure if it is a
bug or feature.
import std.typecons : Nullable;
struct Foo
{
string bar;
Nullable!int baz;
}
auto a = Foo("bb");
auto b = Foo("bb");
assert(a == b);
This end
On Saturday, 18 July 2015 at 13:48:20 UTC, Clayton wrote:
Am new to D programming, am considering it since it supports
compile-time function execution . My challenge is how can I
re-implement the function below so that it is fully executed in
compile-time. The function should result to tabel1 b
On Monday, 20 July 2015 at 14:59:21 UTC, John Colvin wrote:
On Monday, 20 July 2015 at 14:40:59 UTC, jmh530 wrote:
[...]
Everything is exactly as I would expect. Lambdas with => are
just shorthand that skips the return expression and
std.algorithm.each just calls the lambda for each element
On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote:
To implement a new trait
isSortedRange(R, pred)
needed for SortedRange specializations I need a variant of
enum bool isInstanceOf(alias S, T) = is(T == S!Args,
Args...);
that takes the `pred` argument aswell.
But I have no cl
On Sunday, 9 August 2015 at 01:29:16 UTC, Christopher Davies
wrote:
I'm just learning D. Something I often do in C# is have an
IEnumerable (Range) of some type that is then conditionally
filtered. It looks like this:
IEnumerable> foo = bar;
if (baz)
{
foo = foo.Where(d => d["key"] == valu
On Thursday, 13 August 2015 at 08:40:13 UTC, ted wrote:
have upgraded from 2.066.1 to 2.068.0, and have a change in
behaviour:
import std.container: SList;
void main()
{
SList!int tmp;
tmp.insertAfter( tmp[], 3 );
}
used to work happily with dmd2.066.1, causes assert
(core.excepti
On Sunday, 16 August 2015 at 23:40:41 UTC, Brandon Ragland wrote:
On Sunday, 16 August 2015 at 23:31:46 UTC, Ali Çehreli wrote:
On 08/16/2015 04:13 PM, Brandon Ragland wrote:
> That makes more sense. Though it does make the ref method
> signature unclear, as it only applies to literals at this
On Sunday, 16 August 2015 at 17:33:52 UTC, Benjamin wrote:
I'm having an issue with building my app - even a simple
trivial app (shown below).
[...]
OS X version?
Have you configured your dmd.conf? iirc it requires linker path
changes or something.
Have you looked in /usr/local/lib for li
On Monday, 17 August 2015 at 02:45:22 UTC, Brandon Ragland wrote:
Howdy,
Since Dynamic Arrays / Slices are a D feature, using pointers
to these has me a bit confused...
Consider:
Now what is especially confusing about this, is that the above
seems to works fine, while this does not:
if(
On Wednesday, 19 August 2015 at 09:54:33 UTC, SimonN wrote:
Hi,
in a release-like build, I'm using the tharsis profiler, which
is a
frame-based profiler. Zone is a RAII struct that measures how
long its own
lifetime is.
with (Zone(my_profiler, "zone name to appear in output")) {
On Thursday, 20 August 2015 at 20:01:58 UTC, tony288 wrote:
On Thursday, 20 August 2015 at 15:37:35 UTC, Dejan Lekic wrote:
[...]
Thanks, I changed the code and the previous one was already
using shared.
import std.stdio;
import core.time;
import core.thread;
[...]
Keep in mind java may b
On Monday, 7 September 2015 at 08:55:31 UTC, Fra wrote:
I encountered a runtime error in my code and all I can get
(even in debug mode) is the following stacktrace:
object.Error@(0): Access Violation
0x0051C308 in const(nothrow @trusted uint
function(const(void*))) object.Type
On Saturday, 12 September 2015 at 20:05:28 UTC, rcorre wrote:
After upgrading from DMD 2.068.0-1 to DMD 2.068.1-1, my project
began producing a large linker error (when built using dub).
I was able to trace it down to a single line:
target = target.adjacent(Diagonals.yes).randomSample(1).front
On Wednesday, 23 September 2015 at 21:25:15 UTC, tcak wrote:
On Wednesday, 23 September 2015 at 21:14:17 UTC, Adam D. Ruppe
wrote:
On Wednesday, 23 September 2015 at 21:08:37 UTC, tcak wrote:
I wouldn't expect B's constructor to be called at all unless
"super" is used there.
"If no call to co
On Thursday, 24 September 2015 at 11:26:12 UTC, Marc Schütz wrote:
On Thursday, 24 September 2015 at 01:01:09 UTC, Nicholas Wilson
wrote:
On Wednesday, 23 September 2015 at 21:25:15 UTC, tcak wrote:
On Wednesday, 23 September 2015 at 21:14:17 UTC, Adam D.
Ruppe wrote:
[...]
Is there any way
On Friday, 25 September 2015 at 02:37:22 UTC, TheGag96 wrote:
So I'm just doing a small test program here:
http://pastebin.com/UYf2n6bP
(I'm making sure I know quicksort for my algorithms class, I
know functionally this won't work as-is)
I'm on Linux, 64-bit, DMD 2.068.1, and when I try to c
On Friday, 25 September 2015 at 03:12:20 UTC, French Football
wrote:
...without having to loop over the enum?
enum SomeType : string { CHEESE = "cheese", POTATO = "potato" }
string valid_value = "cheese";
string invalid_value = "pizza";
bool test( string value ){
if( value.isConvertableToSo
On Friday, 25 September 2015 at 05:50:58 UTC, Charanjit Singh
wrote:
import std.stdio;
import std.math;
void main()
{
float sum,pi,t;
int n=1;
sum=0;
while (n<100 )
{
t=1/( n*n);
n=n+1;
sum=sum+t;
}
writeln("value of PI= " , (sum*6)^^.5);
that is pi pr
so I have a bunch of enums (0 .. n) that i also want to represent
as flags ( 1 << n foreach n ). Is there anyway to do this other
than a string mixin?
use like:
enum blah
{
foo,
bar,
baz,
}
alias blahFlags = EnumToFlags!blah;
static assert(blahFlags.baz == 1 << blah.baz)
On Tuesday, 29 September 2015 at 06:08:03 UTC, Cauterite wrote:
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
You coul
On Tuesday, 29 September 2015 at 09:18:52 UTC, John Colvin wrote:
On Tuesday, 29 September 2015 at 03:31:44 UTC, Nicholas Wilson
wrote:
so I have a bunch of enums (0 .. n) that i also want to
represent as flags ( 1 << n foreach n ). Is there anyway to do
this other than a string mixin?
use li
On Monday, 5 October 2015 at 11:31:32 UTC, Radu wrote:
There is a weird rule on how compiler treats alias this for the
N and S types bellow.
[...]
Please file a bug report.
Also do the errors change if you reverse the order in T i.e.
alias T = Algebraic!(S,N); ?
On Thursday, 8 October 2015 at 09:29:30 UTC, tcak wrote:
I am "trying" to write a function that takes an array of items,
and returns the length of longest item.
[code]
size_t maxLength(A)( const A[] listOfString ) if( __traits(
hasMember, A, "length" ) )
{
return 0; // not implemented
so I have a main as follows
int main(string[] args)
{
int a = 3;
map!((int x) => x*x)((GlobalPointer!int(&a)),a);
return 0;
}
I want to get the mangleof of the generated call to map but
without referencing it in the .o and then pass the mangleof to
another function. the call to map
On Sunday, 24 July 2016 at 06:03:59 UTC, Nicholas Wilson wrote:
so I have a main as follows
int main(string[] args)
{
int a = 3;
map!((int x) => x*x)((GlobalPointer!int(&a)),a);
return 0;
}
I want to get the mangleof of the generated call to map but
without referencing it in the .o
On Sunday, 24 July 2016 at 06:03:59 UTC, Nicholas Wilson wrote:
so I have a main as follows
int main(string[] args)
{
int a = 3;
map!((int x) => x*x)((GlobalPointer!int(&a)),a);
return 0;
}
I want to get the mangleof of the generated call to map but
without referencing it in the .o
dub build has the --compiler= option.
Is there any way to set it to default a custom version (own
branch, resides in ../../ldcbuild/bin/ldc2 ) of ldc2 in the
dub.json (or .sdl)?
The project will only compile with that compiler.
On Sunday, 31 July 2016 at 03:04:27 UTC, Gorge Jingale wrote:
I like to build structures using template mixins because one
can pick and choose functionality at compile time, but still
have a relationship between different types.
It would be really nice if one could sort of test if a template
On Tuesday, 2 August 2016 at 08:22:15 UTC, Saurabh Das wrote:
On Tuesday, 2 August 2016 at 08:20:22 UTC, Saurabh Das wrote:
On Tuesday, 2 August 2016 at 08:16:48 UTC, Sean Campbell wrote:
[...]
Thanks. Yes that is one approach. I figured out another
approach that seems decent:
auto targetF
On Wednesday, 10 August 2016 at 12:36:14 UTC, Arafel wrote:
Hi,
I'm trying to check at compilation time if a given type
implements some operator (let's assume it's '+' in this case),
without caring about the type of the parameters it accepts.
Since operator overloading is expressed in D throu
On Monday, 22 August 2016 at 22:01:51 UTC, ciechowoj wrote:
Is it possible to generate an argument list that contains
pointers to local variables at compile time?
For example, consider following code:
template Repeat(alias int N, alias variable)
{
// Magic
alias Repeat = /* Even more
On Saturday, 27 August 2016 at 04:44:10 UTC, MGW wrote:
Method which I use now:
source D:
-
extern (C) {
int on_metFromD(CEditWin* uk, int aa, int bb) {
return (*uk).metFromD(int aa, int bb);
}
}
class CEditWin {
. . .
// Method for to call
int metFromD(int a
On Sunday, 28 August 2016 at 08:20:52 UTC, MGW wrote:
On Saturday, 27 August 2016 at 07:13:01 UTC, Nicholas Wilson
wrote:
easiest method would be to mark the D class extern(C++) noting
that in C++ a D class reference becomes a pointer to the C++
class.
In "the D class extern(C++)" do't work p
On Friday, 2 September 2016 at 06:56:07 UTC, Lutger wrote:
I was looking for something like FirstOrDefault* from .NET in
phobos. For example, I have this piece of code:
string findBobOrReturnNull(string[] names)
{
auto r = names.find("bob");
if(r.empty) return null;
return r.front;
On Sunday, 4 September 2016 at 20:12:09 UTC, Abhishek Mishra
wrote:
Hi! I am a newbie and I would like to know more about D
language. I have prior knowledge of C++(12th Grade/
Pre-University College Level). How should I start? What more do
I need to learn. Thanks in advance. :)
in addition to
On Saturday, 3 September 2016 at 17:13:49 UTC, Darren wrote:
On Saturday, 3 September 2016 at 16:07:52 UTC, Mike Parker
wrote:
[...]
The dynamic array! Thank you so much, I changed that on
another file and it finally drew the triangle. And I ran your
code and it works brilliantly. I shoul
On Tuesday, 13 September 2016 at 08:19:04 UTC, Johan Engelen
wrote:
In the binary heap documentation, I read that
`BinaryHeap.front()` "Returns a copy of the front of the heap".
[1]
Is there no function to access the front of the heap without a
copy? (micro-optimization)
Thanks,
Johan
[1]
On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote:
I have a tuple of strings generated at compile time, for
example:
alias names = AliasSeq!("Alice", "Bob");
How is it possible to construct a range of strings from this,
in order to use it at runtime with other range algorithms?
F
On Tuesday, 20 September 2016 at 12:35:18 UTC, Basile B. wrote:
I've recently started an easing/interpolation family of
function in my D user library. It's based on something I know
well since I've already used them in 2012 in a VST plugin
called GrainPlot (RIP).
However for one of the functi
On Wednesday, 21 September 2016 at 08:21:29 UTC, Basile B. wrote:
On Wednesday, 21 September 2016 at 01:34:06 UTC, Nicholas
Wilson wrote:
On Tuesday, 20 September 2016 at 12:35:18 UTC, Basile B. wrote:
[...]
So if we rearrange and take the logs of both sides and divide
by c we get
2*log(1-
On Sunday, 25 September 2016 at 04:54:31 UTC, grampus wrote:
Dear all
For example, I have a struct
struct point{int x;int y}
point a;
Is there an easy way to access x and y by using a["x"] and
a["y"]
I guess I need to overload [], but can't figure out how.
Someone can help? Thank you very m
On Thursday, 29 September 2016 at 07:10:44 UTC, Straivers wrote:
Hi,
Say I wanted to create an object that has a string member, and
I want the string to be allocated with the object contiguously
instead of as a pointer to another location (as a constructor
would do). For example:
class C {
On Saturday, 15 October 2016 at 01:46:52 UTC, Chris Nelson wrote:
I'm mainly a scripting language, .NET, and SQL programmer. I've
been looking for a good programming language for Linux/BSD
other than Python. I've surveyed the options and D appears to
be a sane modern choice for me. (Thanks Ali
doctype html
html
body
-foreach(s; images)
// it doesn't seem to like #{s} or !{s}
img(src=s)
--
shared static this()
{
auto router = new URLRouter;
router.registerWebInterface(new CamController);
auto settings = new HTTPServerSettings;
On Wednesday, 26 October 2016 at 12:57:24 UTC, wobbles wrote:
On Wednesday, 26 October 2016 at 12:42:09 UTC, Nicholas Wilson
wrote:
[...]
When you get the 404, do you see the contents of
'writeln(images);' in your terminal?
yes.
the 404 is only for the image the page still renders fine, bu
On Wednesday, 26 October 2016 at 18:39:00 UTC, Rene Zwanenburg
wrote:
On Wednesday, 26 October 2016 at 12:42:09 UTC, Nicholas Wilson
wrote:
[...]
You need to make the images accessible over HTTP. Note the use
of staticFileServer in the following example:
http://vibed.org/docs#http-routing
So I'm trying to debug a project with the work flow of
ssh into remote box
edit/compile/run
if it hangs yank the power out
repeat
this appears to corrupt the the last modification time to some
time in the future and leads to the warning
File '../.dub/packages/vibe-d-0.7.29/vibe-d
On Saturday, 5 November 2016 at 02:24:00 UTC, Konstantin
Kutsevalov wrote:
Hi,
is there a way to catch system signal of "kill" command or
"shutdown"?
PS: are there some other ways also to send signals to running a
D application?
have a look in std.process
I don't think you can catch kill.
On Tuesday, 8 November 2016 at 13:22:35 UTC, RazvanN wrote:
Sorry, I accidentally posted the above message and I don't know
how to erase it.
You can't, this is a mailing list not a forum.
The following post is the complete one:
Given the following code:
int[] arr = [1, 2, 9, 4, 10, 6];
auto
On Saturday, 19 November 2016 at 06:54:37 UTC, xky wrote:
hello.
i got a problem when i build my source code(windows7 x64 /
DMD32 D Compiler v2.072.0), here:
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-201
On Sunday, 20 November 2016 at 11:19:24 UTC, Tofu Ninja wrote:
I feel like this should be simple but I can't seem to figure it
out. How do I declare a function to have the same call
signature as another function/callable type?
Like if I have:
alias Sig = int function(int x, int y);
How do I
On Sunday, 20 November 2016 at 11:19:24 UTC, Tofu Ninja wrote:
I feel like this should be simple but I can't seem to figure it
out. How do I declare a function to have the same call
signature as another function/callable type?
Like if I have:
alias Sig = int function(int x, int y);
How do I
On Sunday, 20 November 2016 at 18:58:04 UTC, Basile B. wrote:
On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote:
[...]
For me there's no exception. Maybe the GC is poluted. Try to
add this after each iteration in the first test loop:
import core.memory: GC;
GC.collect()
On Tuesday, 22 November 2016 at 12:21:18 UTC, Yuxuan Shui wrote:
Is there a way to get a template function return type with
instantiating it? The return type is independent of the
template arguments.
I'm asking because there's potentially recursive template
instantiation if I do try to instan
Is there any reason why
mixin template Foo(T)
{
}
Struct Bar(ailas a)
{
mixin a!int
}
doesn't work?
It gives an error saying that mixin templates are not normal
templates.
I hacked around this by making Bar take an enumeration and then
"static switch"ing on it to select the correct mixin
On Friday, 25 November 2016 at 01:08:38 UTC, ketmar wrote:
On Friday, 25 November 2016 at 00:43:25 UTC, Nicholas Wilson
wrote:
works like a charm:
mixin template Foo(T) {
int z = 42;
}
auto Bar(alias a) () {
mixin a!int;
return z;
}
void main () {
writeln(Bar!Foo);
}
Hmm, maybe i
On Sunday, 27 November 2016 at 06:01:13 UTC, Tofu Ninja wrote:
Basically the title says it all.
alias A = AliasSeq!(...);
alias B = AliasSeq!(...);
static assert(A.length == B.length);
template T(An, Bn){ ... }
alias C = AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])); // how
to make this :/
How
On Sunday, 27 November 2016 at 06:01:13 UTC, Tofu Ninja wrote:
Basically the title says it all.
alias A = AliasSeq!(...);
alias B = AliasSeq!(...);
static assert(A.length == B.length);
template T(An, Bn){ ... }
alias C = AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])); // how
to make this :/
How
On Sunday, 27 November 2016 at 11:49:25 UTC, Suliman wrote:
On Sunday, 27 November 2016 at 11:21:58 UTC, drug007 wrote:
On 27.11.2016 14:07, Suliman wrote:
I am getting deprecation message:
"Using the result of a comma expression is deprecated" on
this code:
string sqlinsert = (`INSERT INTO
On Sunday, 27 November 2016 at 12:59:32 UTC, Timoses wrote:
Hi there,
I've got a problem interfacing to a C library.
The following structs are used by the library's .d file that
I've written.
struct neo4j_map_entry_t
{
neo4j_value_t key;
neo4j_value_t value;
};
s
On Sunday, 27 November 2016 at 13:54:54 UTC, Adam D. Ruppe wrote:
On Sunday, 27 November 2016 at 12:59:32 UTC, Timoses wrote:
[...]
It is a linker problem because you didn't link to it... D
structs have an initializer, even if they are used for
interfacing with C. This is a small blob of dat
On Monday, 28 November 2016 at 11:26:41 UTC, dm wrote:
Hi.
Is it possible to write in D something like this?
```
abstract class MyClass(T)
{
public:
@property const(T) value(){return _value;}
@property void value(T val){_value = val;}
...
private:
T _value;
...
}
...
class MyClassFl
On Tuesday, 29 November 2016 at 10:21:24 UTC, Anders S wrote:
Hi guys,
just started to get into Dlang, comming from C and C++ I like
to use methods like there if possible.
Now I want to catenate something like this, but don't get it to
work
in standard C i code:
char str[80];
sprintf(
On Tuesday, 29 November 2016 at 23:33:19 UTC, Ali Çehreli wrote:
On 11/29/2016 07:30 AM, Anders S wrote:
> INTargv[1];/* list of arguments */
Speculation, but given that you say "list of args" is it possible
OP means to use int[0] for an inline array.
In addition to what Ne
On Thursday, 1 December 2016 at 01:58:13 UTC, Timothee Cour wrote:
eg:
```
dlib.d:
extern(C) void dfun(){assert(0, "some_msg");}
clib.cpp:
extern "C" void dfun();
void fun(){
try{
dfun();
}
catch(...){
// works but how do i get "some_msg" thrown from D?
}
}
```
portably not su
On Thursday, 1 December 2016 at 22:05:06 UTC, Timothee Cour wrote:
I want to update a library with new symbols (ie partial
recompilation):
libmylib.so : compiled from bar.d and foo.d
now update the file foo.d
dmd -c -fPIC foo.d -offoo.o
clang++ -o libmylib_update.so foo.o -shared -Wl,-lmylib
On Thursday, 1 December 2016 at 23:51:19 UTC, Payotz wrote:
So, to give context, I am trying to make an event manager for a
game I'm making.
I was writing the "register()" method so I ran into a problem.
The register method will take in delegates as an argument, but
those delegates have varied
On Saturday, 3 December 2016 at 09:51:00 UTC, John C wrote:
Some DirectX methods return structs by value, but when I try
calling them I either get garbage or an access violation.
[...]
I know for ldc that function that return struct by value actually
return by a hidden return parameter point
On Monday, 5 December 2016 at 22:10:34 UTC, Nordlöw wrote:
On Monday, 5 December 2016 at 21:48:49 UTC, Nordlöw wrote:
Ahh, setops has intersection aswell:
https://dlang.org/phobos/std_algorithm_setops.html#setIntersection
I should have a guessed that.
Ahh again, but current Phobos is current
On Tuesday, 6 December 2016 at 01:46:38 UTC, Nicholas Wilson
wrote:
On Monday, 5 December 2016 at 22:10:34 UTC, Nordlöw wrote:
On Monday, 5 December 2016 at 21:48:49 UTC, Nordlöw wrote:
Ahh, setops has intersection aswell:
https://dlang.org/phobos/std_algorithm_setops.html#setIntersection
I s
Whoops forgot to add checks for .empty on the ranges, and I don't
think reduce!equal work but you get the point.
On Monday, 5 December 2016 at 20:49:50 UTC, e-y-e wrote:
On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko
wrote:
[...]
You know from the 15th December I will have a month of free
time, and I would love to get myself up to speed with Mir to
contribute to it. If you don't mind me sa
On Saturday, 10 December 2016 at 13:21:40 UTC, notna wrote:
On Saturday, 10 December 2016 at 08:03:00 UTC, biozic wrote:
[...]
Well, you know, that's one of the not so great things about
Dlang... you cannot even trust the provided examples, if there
are any:
[...]
Those statements ne
On Sunday, 11 December 2016 at 02:09:41 UTC, Orut wrote:
D nub here. I have a Python script that I'd like to implement
in D. For certain parts, the D equivalent was slower than
Python's. For example,
Python code:
#dummy code
s = ["abc", "fjkd", "L", "qwa", "r", "uw", "tiro", "bc", "sg",
"k",
401 - 500 of 613 matches
Mail list logo