On Sunday, 16 November 2014 at 10:41:20 UTC, deadalnix wrote:
module a;
struct A(alias foo) {
auto foo() {
return foo();
}
}
module b;
import a;
void main() {
auto a = A!bar();
}
private int bar() { return 42; }
This do not work. I think it is a bug but I see how could
On Tuesday, 11 November 2014 at 19:23:39 UTC, Adam Taylor wrote:
* i apologize in advance, this is my first post -- the code
formatting probably wont turn out so great...
I have a bunch of duck typed interfaces for containers
similar to what you would find in std.range.
i.e.
template
Why is size_t an alias and not a typedef(or a struct that is not
implictly convertable)
test.d
void main(){
ulong a;
size_t b=a;//only compiles on 64-bit
}
$ dmd -m64 test
$ dmd -m32 test
test.d(3): Error: cannot implicitly convert expression (a) of
type ulong to uint
On Wednesday, 5 November 2014 at 19:27:59 UTC, Jonathan Marler
wrote:
I've been thinking about how to handle templates that have
typically been using the 'ref' parameter attribute because they
modify the parameter. For example, the put/doPut functions in
std.range use the 'ref' attribute for
On Saturday, 1 November 2014 at 00:04:18 UTC, Jakob Ovrum wrote:
On Tuesday, 28 October 2014 at 22:44:32 UTC, Freddy wrote:
http://wiki.dlang.org/DIP67
Abstraction over the build-in associative array(one type of
range
for containers and another type for dynamic generators).
Plese criticize.
On Wednesday, 29 October 2014 at 18:04:30 UTC, John Colvin wrote:
On Wednesday, 29 October 2014 at 17:36:41 UTC, H. S. Teoh via
Digitalmars-d wrote:
On Wed, Oct 29, 2014 at 05:23:07PM +, Brad Anderson via
Digitalmars-d wrote:
On Wednesday, 29 October 2014 at 06:59:09 UTC, bearophile
wrote:
On Wednesday, 29 October 2014 at 18:40:51 UTC, Freddy wrote:
On Wednesday, 29 October 2014 at 18:04:30 UTC, John Colvin
wrote:
On Wednesday, 29 October 2014 at 17:36:41 UTC, H. S. Teoh via
Digitalmars-d wrote:
On Wed, Oct 29, 2014 at 05:23:07PM +, Brad Anderson via
Digitalmars-d wrote:
On
On Wednesday, 29 October 2014 at 19:55:14 UTC, H. S. Teoh via
Digitalmars-d wrote:
On Wed, Oct 29, 2014 at 06:40:50PM +, Freddy via
Digitalmars-d wrote:
On Wednesday, 29 October 2014 at 18:04:30 UTC, John Colvin
wrote:
On Wednesday, 29 October 2014 at 17:36:41 UTC, H. S. Teoh via
On Tuesday, 28 October 2014 at 22:44:32 UTC, Freddy wrote:
http://wiki.dlang.org/DIP67
Abstraction over the build-in associative array(one type of
range
for containers and another type for dynamic generators).
Plese criticize.
Does any one now a better way to implement lazy associative
http://wiki.dlang.org/DIP67
Abstraction over the build-in associative array(one type of range
for containers and another type for dynamic generators).
Plese criticize.
On Wednesday, 22 October 2014 at 20:29:58 UTC, Cjkp wrote:
Hello, I have an idea about a small code tool related to the
application resources.
It would rely on the assumption that some global variabled,
sharing the same type and attributes, declared in group, are
contiguous.
In short I need
On Tuesday, 21 October 2014 at 12:22:54 UTC, edn wrote:
Could someone provide me with examples showing the usefulness
of pointers in the D language? They don't seem to be used as
much as in C and C++.
https://en.wikipedia.org/wiki/XOR_linked_list
Is there any advice/tips for reading medium/big D codebases?
I recently thought of the idea of using string imports for
compile time configuration.
Something like this
---
import std.stdio;
import std.conv;
import std.range;
import std.algorithm;
string getVar(string fname,string var)(){
foreach(property;import(fname).splitter('\n')){
On Tuesday, 7 October 2014 at 20:55:59 UTC, Laeeth Isharc wrote:
Hi.
I am trying to create a shared library in D linked against
phobos so that I may use this in a cython extension module for
Python. Ultimately I would like to be able to use a D class or
struct (via the C++ interface) and
On Monday, 29 September 2014 at 10:49:53 UTC, Andrei Alexandrescu
wrote:
Back when I've first introduced RCString I hinted that we have
a larger strategy in mind. Here it is.
The basic tenet of the approach is to reckon and act on the
fact that memory allocation (the subject of allocators) is
On Sunday, 28 September 2014 at 21:29:21 UTC, Cliff wrote:
Coming from the C# world, all of localization we did was based
on defining string resource files (XML-formatted source files
which were translated into C# classes with named-string
accessors by the build process) that would get
On Sunday, 28 September 2014 at 17:47:42 UTC, Abdulhaq wrote:
Here's a code snippet which mopefully makes things a bit
clearer:
/**
* In this example the variable foo can be statically analysed
as safe to go on the stack.
* The new instance of Bar allocated in funcLevelB is only
referred to
On Friday, 26 September 2014 at 16:43:30 UTC, Olivier Leduc wrote:
Hello,
I need to use a C++ SDK to create a plugin an existing closed
source c++ application and I would like to know if its possible
to use D for that task.
Would is be possible to port the SDK header files and call the
On Friday, 26 September 2014 at 16:43:30 UTC, Olivier Leduc wrote:
Hello,
I need to use a C++ SDK to create a plugin an existing closed
source c++ application and I would like to know if its possible
to use D for that task.
Would is be possible to port the SDK header files and call the
On Tuesday, 23 September 2014 at 15:19:59 UTC, Andre wrote:
Hi,
I just wonder why with (auto p = new ...) is not working.
It would be some syntax sugar in this scenario:
with (auto p = new Panel())
{
parent = this;
text = bla;
On Friday, 26 September 2014 at 19:59:56 UTC, Freddy wrote:
On Tuesday, 23 September 2014 at 15:19:59 UTC, Andre wrote:
Hi,
I just wonder why with (auto p = new ...) is not working.
It would be some syntax sugar in this scenario:
with (auto p = new Panel())
{
Is this supposed to happen?
---
import std.typecons;
alias feet=Typedef!(float,0.0,feet);
alias meter=Typedef!(float,0.0,meter);
void main(){
feet a=4.0;
meter b=5.0;
meter c=a*b;//opps
pragma(msg,typeof(c));
}
---
$dmd -o- typetest.d
Typedef!(float, 0.0F,
On Sunday, 21 September 2014 at 18:24:53 UTC, Freddy wrote:
Is this supposed to happen?
---
import std.typecons;
alias feet=Typedef!(float,0.0,feet);
alias meter=Typedef!(float,0.0,meter);
void main(){
feet a=4.0;
meter b=5.0;
meter c=a*b;//opps
How do you include liblzma
bindings(https://github.com/D-Programming-Deimos/liblzma) in a
dub project?
When you have separate 2 typedefs of the exact same type, they
are equal.While this maybe able to be solved with
Typedef!(Typedef!(...)) different modules typedef ing the same
type (most likely build-in types) would have their typedef be
equivalent thereby degrading the purpose of typedef.
---
On Wednesday, 17 September 2014 at 03:08:46 UTC, Jakob Ovrum
wrote:
On Wednesday, 17 September 2014 at 02:57:03 UTC, Freddy wrote:
When you have separate 2 typedefs of the exact same type, they
are equal.While this maybe able to be solved with
Typedef!(Typedef!(...)) different modules typedef
On Tuesday, 16 September 2014 at 01:43:15 UTC, Andrei
Alexandrescu wrote:
My understanding of this situation is different. We've wronged
the man in the past and a sign of good will from us would go a
long way. Andrei
What The D community do wrong in the first place?
How would you create a mutable array with a fixed(compile error
when trying to change) length.
On Monday, 11 August 2014 at 05:19:01 UTC, Jeremy DeHaan wrote:
I am looking at these versions as described here:
http://dlang.org/version.html
There are X86 and X86_64 version identifiers, but these
specifically mention that they are versions for the processor
type. Can they also be used to
I'm trying to implement a opApply outside of struct scope
struct A{
int[] arr;
}
int opApply(ref A a,int delegate(ref int) dg){
return 0;
}
void main(){
A a;
foreach(i;a){//i just want it to compile
}
}
when i try compiling, the
As of now Associative Ranges are defined as:
static assert(isInputRange!R);
R r=void;
auto v=r.front;//r is an input range
static assert(isInputRange!(typeof(r.byKey)));
auto k=r.byKey.front;//byKey is an input range
static assert(is(typeof(v) ==typeof(r[k]) ));//opIndex of k
static
On Saturday, 9 August 2014 at 01:34:38 UTC, Freddy wrote:
As of now Associative Ranges are defined as:
static assert(isInputRange!R);
R r=void;
auto v=r.front;//r is an input range
static assert(isInputRange!(typeof(r.byKey)));
auto k=r.byKey.front;//byKey is an input range
static
On Monday, 4 August 2014 at 09:21:40 UTC, Marc Schütz wrote:
On Sunday, 3 August 2014 at 18:38:51 UTC, Freddy wrote:
On Sunday, 3 August 2014 at 08:50:47 UTC, Marc Schütz wrote:
3) For the value and key ranges, there should be a guarantee
that they can be zipped through, i.e. that the elements
On Tuesday, 5 August 2014 at 00:11:21 UTC, Freddy wrote:
On Monday, 4 August 2014 at 09:21:40 UTC, Marc Schütz wrote:
On Sunday, 3 August 2014 at 18:38:51 UTC, Freddy wrote:
On Sunday, 3 August 2014 at 08:50:47 UTC, Marc Schütz wrote:
3) For the value and key ranges, there should be a
On Monday, 4 August 2014 at 09:21:40 UTC, Marc Schütz wrote:
On Sunday, 3 August 2014 at 18:38:51 UTC, Freddy wrote:
On Sunday, 3 August 2014 at 08:50:47 UTC, Marc Schütz wrote:
3) For the value and key ranges, there should be a guarantee
that they can be zipped through, i.e. that the elements
On Monday, 4 August 2014 at 10:30:40 UTC, Marc Schütz wrote:
On Sunday, 3 August 2014 at 23:41:27 UTC, Freddy wrote:
I am currently working on a phobos fork to include associative
ranges, however the unittest fail when i try to build. How am a
supposed test any unittests that i add.
On Friday, 1 August 2014 at 23:57:37 UTC, Freddy wrote:
I just curious, do Associative Ranges exist. If so where can i
find them. I started thinking about them when i asked this
question:
http://forum.dlang.org/thread/vauuognmhvtjrktaz...@forum.dlang.org
I started a phobos fork for this, what
On Sunday, 3 August 2014 at 08:50:47 UTC, Marc Schütz wrote:
On Sunday, 3 August 2014 at 06:19:12 UTC, Freddy wrote:
On Friday, 1 August 2014 at 23:57:37 UTC, Freddy wrote:
I just curious, do Associative Ranges exist. If so where can i
find them. I started thinking about them when i asked this
On Sunday, 3 August 2014 at 08:50:47 UTC, Marc Schütz wrote:
On Sunday, 3 August 2014 at 06:19:12 UTC, Freddy wrote:
On Friday, 1 August 2014 at 23:57:37 UTC, Freddy wrote:
I just curious, do Associative Ranges exist. If so where can i
find them. I started thinking about them when i asked this
I am currently working on a phobos fork to include associative
ranges, however the unittest fail when i try to build. How am a
supposed test any unittests that i add.
link:https://github.com/Superstar64/phobos/tree/associative_ranges
$ ../dmd/src/dmd |head -1
DMD32 D Compiler
On Saturday, 2 August 2014 at 15:46:31 UTC, Xinok wrote:
On Saturday, 2 August 2014 at 14:49:49 UTC, bearophile wrote:
Xinok:
I do wonder if we should generalize an interface for these
types of ranges.
First of all you need some use cases and usage examples.
Bye,
bearophile
The most
I just curious, do Associative Ranges exist. If so where can i
find them. I started thinking about them when i asked this
question:
http://forum.dlang.org/thread/vauuognmhvtjrktaz...@forum.dlang.org
#!/usr/bin/rdmd
import std.algorithm;
import std.stdio;
uint[uint] test;
void main(){
test=[0:2 ,1:3 ,2:4];
writeln(test.map!(a=a-2));
}
$ ./test.d
./test.d(8): Error: template std.algorithm.map cannot deduce
function from argument types !((a) = a - 2)(uint[uint]),
candidates
On Friday, 1 August 2014 at 23:22:06 UTC, bearophile wrote:
Freddy:
uint[uint] test;
void main(){
test=[0:2 ,1:3 ,2:4];
writeln(test.map!(a=a-2));
}
If you need keys or values you have .keys .values, .byKey,
.byValue (the first two are eager). If you need both you are
out
link: https://github.com/Superstar64/tornado-pool
This is a heavy work in progress streaming library, i'm not even
sure if some parts of it compile.
check out tpool/samples.d
101 - 146 of 146 matches
Mail list logo