Re: a "success story for D" ! !!

2015-05-06 Thread d coder via Digitalmars-d
> > > This is great going, Puneet. Congratulations, good luck, and keep us all > posted! -- Andrei > Thanks Andrei. And thanks again to Walter, yourself, Kenji and other developers who together made D a wonderful language.

Re: a "success story for D" ! !!

2015-05-06 Thread d coder via Digitalmars-d
Unlike mainstream software, it requires a lot of effort to get hardware > guys interested in software. > I meant to say "interested in *opensource* software"

Re: a "success story for D" ! !!

2015-05-06 Thread d coder via Digitalmars-d
Greetings > half the site is 404, the github account show little activity and > information pretty sparse. smells kinda dubios.. > I am really sorry for the poor webpage. We are actively working on that front, but progress is slow since we need to give priority to customer projects. We are an un

Re: a "success story for D" ! !!

2015-05-06 Thread d coder via Digitalmars-d
> But, a fair chunk of code. Maybe there's little activity recently because > they consider it done. I haven't committed to the majority of my github > things for months, but I still stand by them. > Greetings I am the lead developer of Vlang. Vlang is still being actively worked on. We are not

Bug with nested static class referencing?

2015-01-18 Thread d coder via Digitalmars-d
Greetings I hit what looks like a probable DMD bug. When I reduced with help from dustmite I get something like this. Can someone tell me if this is a bug or am I doing something illegal? class A { B.BB b; } class B: A { static class BB {} } When I compile I get: test.d(2): Error: no prope

Why this UDP will not compile?

2014-09-27 Thread d coder via Digitalmars-d
DMD wont compile this. I get an error saying: /tmp/test.d(3): Error: need 'this' for 'foo' of type 'int' Failed: ["dmd", "-v", "-o-", "/tmp/test.d", "-I/tmp"] Is this a bug or is it illegal code? // Regards // Cherry class Foo { int foo = 42; @foo int bar; this(int frop) { foo = frop;

Re: Member function pointers

2014-05-27 Thread d coder via Digitalmars-d
https://github.com/D-Programming-Language/dmd/pull/3181 Daniel asked me to use this. And it works. Use something like: union U { void delegate(int) dg; struct { void* ptr; void function(int) funcptr; } } U u; u.dg = dg; u.funcptr = ...; u.ptr = ...; Regards - Puneet

Re: Member function pointers

2014-05-27 Thread d coder via Digitalmars-d
On Mon, Jun 10, 2013 at 10:13 PM, Jacob Carlborg wrote: > On 2013-06-10 18:34, Manu wrote: > >> On 11 June 2013 02:26, Jacob Carlborg mailto:d...@me.com>> >> >> wrote: >> >> On 2013-06-10 17:40, David Nadlinger wrote: >> >> Let me try to summarize it in code: >> >> --- >>

Re: Test

2013-10-13 Thread d coder
On Sun, Oct 13, 2013 at 9:56 PM, Iain Buclaw wrote: > I don't think I'm receiving emails from this ML. Is anyone else seeing > this? I generally use mailing list interface and I am seeing your post on mailing list.

Re: DConf 2013 last talk

2013-10-13 Thread d coder
On Sat, May 4, 2013 at 12:41 AM, Rob T wrote: > I have significantly reduced CG performance issues (up to 3x faster) with > strategically placed disabling and enabling of the GC, so it may be that > the problem can be solved using carefully placed GC.disable and GC.enable > calls at points in the

Re: Using emplace leading to memory corruption

2013-09-29 Thread d coder
> I tried that and it still crashes. I don't think that's the problem. > Puneet, the code looks legit, please file a bug report. Thanks for confirming. http://d.puremagic.com/issues/show_bug.cgi?id=11139 Regards - Puneet

Using emplace leading to memory corruption

2013-09-29 Thread d coder
Greetings I am trying to use emplace and it is seemingly leading to memory corruption. Before I file a bug on DMD Buzilla, I want to find out if I am doing something wrong or if it is a known issue. I am using a linux box and this testcase is freaky -- if I comment out either line 20 or line 24, t

Re: UFCS requires explicit this

2013-05-04 Thread d coder
Timon, you mean such support is planned, or is the current behavior the expected behavior. Regards - Puneet On Sat, May 4, 2013 at 4:57 PM, Timon Gehr wrote: > This is to be expected. >

UFCS requires explicit this

2013-05-04 Thread d coder
Greetings Consider the following code ... class Foo { // 1 void foo() { // 2 bar(); // 3 this.bar(); // 4 } // 5 } // 6 void bar(Foo f) { // 7 import std.stdio; // 8 writeln("This bar"); // 9 } // 10 void main() { // 11 Foo test = new Foo; // 12 test.foo(); // 13 } // 14 DMD

Re: DConf 2013 last talk

2013-05-02 Thread d coder
On Fri, May 3, 2013 at 5:41 AM, Joseph Cassman wrote: > If you could provide an update on the allocators design and implementation > -- progress and/or roadmap -- that would be great. Also if there are any > plans to update std.container as a result. > +1 And another one. I am working on an emb

GDB support for multithreaded D application debugging

2013-04-29 Thread d coder
Greetings I just wanted to find out how good is the GDB support for debugging multithreaded code written in D language. I remember trying it sometimes back, but could not get it to work. Any suggestions? Regards - Puneet

Trait for listing symbols in a delegate's closure?

2013-04-28 Thread d coder
Greetings I am wondering if there is a way to find out a tuple of all the symbols/identifiers in a given delegates closure. Regards - Puneet

Re: Customized @safe like semantics for user attributes?

2013-03-15 Thread d coder
> There could be other possibilities as well, like a function without @foo > attribute not being able to call a function with the attribute in its body. > > I mean, a function without @foo should not be able to call a function with @foo attribute.

Re: C++ guys hate static_if?

2013-03-09 Thread d coder
Greetings I believe the paper takes a contrived route to criticize "static if". It takes some bad code examples which are not obvious use cases of "static if" and then goes on to say that the resultant code is not good. I think the code example to begin with was not good. Regards - Puneet

Re: D is coming to a town near you

2013-02-20 Thread d coder
On Thu, Feb 21, 2013 at 12:27 AM, H. S. Teoh wrote: > But once I get into the realm of new features introduced in D, like > generic metaprogramming, functional-style code, non-trivial range APIs, > const-correctness, purity, etc., I just keep running into bugs, > unexpected interactions, conflicti

Re: D is coming to a town near you

2013-02-20 Thread d coder
Cool I will try not to sleep when I catch a train next time. :-)

Re: Why does this extremely simple operation not work?

2013-02-12 Thread d coder
In D, class objects are implicitly pointers. So try the following code. class Parent {} class Child : Parent {} void myFunc(Parent obj) { import std.stdio; writeln("got ", obj); } void main() { Child myChild = new Child(); myFunc(myChild); }

pass-by-ref semantics for structs (was Deque impl.)

2013-01-31 Thread d coder
On Thu, Jan 31, 2013 at 5:30 PM, monarch_dodra wrote: > The pull is kind of stuck in limbo, specifically because of the problems > associated with implementing reference semantics with structs :/ Thanks for the enlightening email. I am of the considered view that reference semantics with struct

Re: Deque impl.

2013-01-31 Thread d coder
On Thu, Jan 31, 2013 at 2:43 PM, Robert burner Schadek wrote: > Thats not totally correct. The Rb tree is a class. But the real reason for > the Deque being a class > is that it holds two value members. And if you pass the Deque around you > need to do this as ref. > Otherwise you shall not call a

Re: Deque impl.

2013-01-30 Thread d coder
> To be honest deque can be implemented far better if random access as in > indexing, removal and such is dropped. As other people too pointed out, Deque is indeed a random access range, so indexing operator is a must. Insert/Remove too are good to have. Array implementation in the std.container t

Re: D popularity

2013-01-20 Thread d coder
On Sun, Jan 20, 2013 at 6:21 PM, David wrote: > I am not using the forum, but still sending messages. You can send > messages directly via a NNTP client, you don't have to use the forum, so > it's definitly possible he doesn't know of it. > David, that can be guessed on basis of the email header

Re: Accessing UDA of private field

2013-01-06 Thread d coder
> You can use a string mixin: > > class Foo > { > int a; > @(3) private int b; > } > > void main() > { > writeln(mixin("__traits(getAttributes, " ~ Foo.tupleof[1].stringof ~ > ")")); // -> 3 > } > > > Hmm This works only when main is in the same file (and therefor module) as Foo.

Is this a known issue in Phobos/DMD?

2013-01-05 Thread d coder
Greetings When I compile the code below, I unexpectedly get an error: test.d(7): Error: template std.string.format does not match any function template declaration. Candidates are: /home/puneet/local/github-d/bin/../phobos/std/string.d(2528): std.string.format(Char, Args...)(in Char[] fmt, Args a

Re: struct : implicit conversion for function call arguments

2013-01-01 Thread d coder
> That's not how you define implicit conversions in D. It's a weird hack > from C++. > > Thanks for clarification. I knew about alias this, but I thought it was in addition to constructor path. Regards - Puneet

Re: DList -- removing an element

2012-12-30 Thread d coder
Thanks Jonathan.

DList -- removing an element

2012-12-30 Thread d coder
Greetings I have created a DList of class objects. Now I want to delete a particular object from the list. I do not see a straightforward way of doing that. The only way I found was to create a DList range, take out all other elements from the range using popFront and popBack and then apply remove

Re: add phobos module std.halffloat ?

2012-12-19 Thread d coder
On Wed, Dec 19, 2012 at 3:43 PM, Iain Buclaw wrote: > How difficult would you think it would be to scale down (or up) this > library type so it can be an emulated IEEE type of any size? (The whole > shebang eg: quarter, half, single, double, quad, double-quad, 80bit and > 96-bit). Just interest

Re: UDA: getAttributes does not play well with topleof

2012-12-18 Thread d coder
Greetings I thought I would be able to use allMembers/getMembers traits to access the attributes of all the members of a class. But that fails me if some members of the class are private. Consider the code pasted below -- I get en error: B.d(5): Error: class A.Foo member bar is not accessible A

Re: UDA: getAttributes does not play well with topleof

2012-12-17 Thread d coder
On Mon, Dec 17, 2012 at 9:56 PM, Walter Bright wrote: > On 12/17/2012 3:55 AM, d coder wrote: > >> So my question is: Is this a bug in DMD, or am I doing something plainly >> wrong? >> > > You're doing something wrong. Consider: > > @Bar int i =

Re: UDA: getAttributes does not play well with topleof

2012-12-17 Thread d coder
> Try something like this: > > foreach (i, dummy; foo.tupleof) > { > alias Tuple!(__traits(getAttributes, foo.tupleof[i])) tp; > pragma(msg, tp); > } > > Ok so that is because ref does not work with foreach on tuples. Somehow I thought that got fixed. Anyways, with your suggestion I get a s

Re: UDA: getAttributes does not play well with topleof

2012-12-17 Thread d coder
Ok. It seems to work with allMembers/getMember traits combination. But should it work with tupleof or not? Regards - Puneet

Re: Should alias this support implicit construction in function calls and return statements?

2012-12-13 Thread d coder
I do not know if I am missing something but consider: struct Foo { int r; int i; bool get() { return true; // always return true } alias get this; } So I am wondering how it would be possible to construct Foo from a bool? Otherwise how would the compiler be able to figure out in wh

Re: Nested Structs (Solution)

2012-12-12 Thread d coder
> The name doesn't matter. I just wanted to annoy Walter again with yet >> another bit of evidence that completeness of a feature is important even if >> it doesn't seem to have an obvious use case. People will do what is logical >> and end up with hacks like that. >> > I believe it *is* an obvious

Re: OT (partially): about promotion of integers

2012-12-11 Thread d coder
On Wed, Dec 12, 2012 at 8:14 AM, Walter Bright wrote: > (This is how the high level vector library Manu is implementing is done.) > Greetings Where can I learn more about this library Manu is developing? regards - Puneet

Re: Is there any reason why arithmetic operation on shorts and bytes return int?

2012-12-11 Thread d coder
On Wed, Dec 12, 2012 at 3:40 AM, Walter Bright wrote: > No worries there :-) I feel pretty dang strongly about this issue, from > bad experience. > > Even if a language behaves "wrong", it is still usable if it is > predictable. > Agreed. How about this. 1. Let "char" and "short" behave the C/C

Re: Is there any reason why arithmetic operation on shorts and bytes return int?

2012-12-11 Thread d coder
Thanks Everybody for responding. I have another query which is off-topic but related. Why is the following allowed in D? long a; int b; b += a; // Allowed -- no explicit cast b = a + b; // Not allowed b = a; // Not allowed

Re: Is there any reason why arithmetic operation on shorts and bytes return int?

2012-12-11 Thread d coder
On Tue, Dec 11, 2012 at 7:05 PM, Peter Alexander < peter.alexander...@gmail.com> wrote: > That's the whole point. What you are doing is dangerous, so it requires > the cast. > What I am doing is not dangerous. I am operating at byte/short level. Tell me, if what I am doing is dangerous, how come

Re: Is there any reason why arithmetic operation on shorts and bytes return int?

2012-12-11 Thread d coder
On Tue, Dec 11, 2012 at 6:23 PM, monarch_dodra wrote: > D's stance regarding integer operations is "if it compiles, it creates the > same output as in C". > Thanks Monarch. So it is a gotcha we inherit from C. :-) Regards - Puneet

Re: Is there any reason why arithmetic operation on shorts and bytes return int?

2012-12-11 Thread d coder
For some more clarity, when I compile the following code: void main() { import std.stdio; byte a; byte b; byte c = a + b; } I get error: test.d(6): Error: cannot implicitly convert expression (cast(int)a + cast(int)b) of type int to byte Why is D trying to convert bytes and shorts to int

Is there any reason why arithmetic operation on shorts and bytes return int?

2012-12-11 Thread d coder
Greetings The following code prints . Similar thing happens when a and b are bytes. Is this intended? Regards - Puneet void main() { import std.stdio; ushort a = 0x55AA; ushort b = 0xAA55; writefln("%X", ~(a | b)); }

Re: Need help with debugging Segfault

2012-12-03 Thread d coder
> But it's not a bug. Like Ali said: > > The destruction order of GC-maintained resources is not deterministic as > e.g. in C++. It is quite possible that the member of an object is destroyed > before the object itself. Oops. I get it now. What should be done to avoid this situation? I think I n

Re: Strange struct/atomicLoad behaviour

2012-11-30 Thread d coder
On Fri, Nov 30, 2012 at 7:41 PM, Maxim Fomin wrote: > This is another bug with structures. Consider posting this to bugzilla. > Thanks for confirming. I have posted this to Bugzilla. Regards - Puneet

Re: Congratulations to the D Team!

2012-07-09 Thread d coder
Congratulations. I found that my applications still do not compile using the git HEAD. Waiting eagerly for the 2.060 alpha release. Regards - Puneet

Re: D2 Library Porters

2012-07-04 Thread d coder
> Obtain the gdc sources and install into gcc-core (I > will tarball a copy up that includes the zlib sources too and post a > link). > Greetings Where would I find the gdc source? Then rebuild gcc with the same options above above, but with > --enable-languages=d included. Would this option e

Re: D2 Library Porters

2012-07-03 Thread d coder
> > > I'm going to be pushing gdc-4.8 package into debian this weekend (give > about a fortnight for it to land in sid) - is anyone interested in porting > Druntime / Phobos over to the architectures that Debian supports? I can > give anyone a quick crash course through building a cross compiler i

Re: dmd 2.060 ignoring ref for Array arguments

2012-07-02 Thread d coder
Done. http://d.puremagic.com/issues/show_bug.cgi?id=8335

dmd 2.060 ignoring ref for Array arguments

2012-07-02 Thread d coder
Greetings Normally I use released beta versions of dmd, but this time I started using dmd 2.060 for sake of std.string.xformat. But I am facing issues. This version is ignoring "ref" when passing array as ref argument. Kindly see the code below. When I run this code it prints "Postblit called!" f

Re: std.string.format results in run-time exception

2012-06-30 Thread d coder
Thanks Kenji, I will use xformat. BTW, why is it named "x"format? Would not "s"format be a better name? Where "s" could stand for string. Also I feel, std.string.format should work for BitArray and BigInt too. Both these types are defined as part of phobos. Regards - Puneet

Re: std.string.format results in run-time exception

2012-06-30 Thread d coder
I have files a phobos bug report. http://d.puremagic.com/issues/show_bug.cgi?id=8326 Regards - Puneet

std.string.format results in run-time exception

2012-06-30 Thread d coder
Greetings std.string.format throws runtime exception for BigInt and for BitArray types even though writefln works fine. The run-time error says std.format.FormatException@std/format.d(4744): Can't convert std.bigint.BigInt to string: "string toString()" not defined Here is a small test case. Reg

Re: Made a Rage-Comic about D

2012-06-23 Thread d coder
On Sat, Jun 23, 2012 at 10:58 PM, Tobias Pankrath wrote: > I am currently writing a sat solver for educational purposes How mature is the sat solver yet? Do you plan to release it at some point of time? Regards - Puneet

Re: LinkedList and Deque API in DCollections

2012-06-21 Thread d coder
> > > auto append(T, V)(ref T t, V value) > { > return t.insert(t.begin, value); > } > > should do the trick. > (you may add a guard to make sure T is a container) > Thanks Christophe. I think you are relying on UFCS here. So cool. Regards - Puneet

Re: LinkedList and Deque API in DCollections

2012-06-21 Thread d coder
> Also, I see that "assert(some-expression)" has been used at a lot of > places in the code of the libraries. Since these libraries are built with > -release option, should these assert statements not be replaced by > "enforce"? Ok I think asserts are fine since these would be taken out and the l

Re: LinkedList and Deque API in DCollections

2012-06-21 Thread d coder
> > > Did you try : list.insert(list.begin, value); > Thanks. But I believe append and prepend are too common use-cases to be ignored. Also, I see that "assert(some-expression)" has been used at a lot of places in the code of the libraries. Since these libraries are built with -release option, sh

LinkedList and Deque API in DCollections

2012-06-21 Thread d coder
Greetings I do not know if this email belongs to this list or not. It is about a package available at dsource. Let me know if I should be posting such emails elsewhere. I need an implementation of Doubly Linked list and Deque. Since the std.container library does not support these containers yet,

Freelists and clear/emplace

2012-06-15 Thread d coder
Greetings Is emplace/clear mechanism mature enough to be used to create freelists? I looked but found very scanty documentation on emplace/clear on dlang.org. Regards - Puneet

Re: Calling an alias for a Class method in another scope

2012-06-02 Thread d coder
> > > At the moment, the ref-ness of the return type is not determined > correctly because of a compiler bug. Otherwise, that works mostly > fine. > > Thank you Max for showing me toDelegate. But I find that it does not work even for function arguments with default values. So for the moment I will

DMD does not allow stringof on function alias of a function that takes arguments

2012-06-02 Thread d coder
Greetings All Using DMD 2.059, the following code does not compile. DMD does not allow me to apply stringof on a function alias of a function that takes one or more arguments. It compiles and runs fine for functions that do not take any arguments. Is it a bug, or am I doing something wrong here?

Re: Website

2012-06-01 Thread d coder
> Huh, wasn't Digital Daemon the previous site at dlang.org address? > No. Digital Daemon is the hosting company that hosts dlang.org as well as digitalmars.com. Yesterday even digitalmars.com was leading me to Digital Daemon page. As Walter has said, it was a technical problem with the hosting.

Re: Calling an alias for a Class method in another scope

2012-06-01 Thread d coder
Steve One small thing. As you said I might declare a delegate in an alternate fashion that is by saying "void delegate() dg;". But would it be possible to rewrite the following declaration in a way that avoids naming foo explicitly. I would just have an alias for foo. I am asking this to cover th

Re: Calling an alias for a Class method in another scope

2012-06-01 Thread d coder
On Fri, Jun 1, 2012 at 7:40 PM, Mehrdad wrote: > Another way to phrase it would be that D is forcing you to to use > templates where they really aren't meant to be used. :\ > > No. I am working on a Domain Specific Language and want to cut on the code the end user has to write. If I were working

Re: Calling an alias for a Class method in another scope

2012-06-01 Thread d coder
Hello Steve > There is a way, as I hinted :) > > I'll show you how, but be prepared to deal with ugliness! > All this smart code would be hidden from the end-users so I really do not care. > typeof(&F.init.foo) dg; // alternately: void delegate() dg; > dg.funcptr = &F.foo;// use the type,

Re: Calling an alias for a Class method in another scope

2012-06-01 Thread d coder
Hello Steve, thanks for looking at this. I see the code works when I create the delegate first and then send it to template. That is the way you do it here. > void main() { > Foo f = new Foo(); > auto dg = &f.foo; // need to make a symbol so it can be aliased > callfoo!(dg)(); > } > > But it

Re: Calling an alias for a Class method in another scope

2012-06-01 Thread d coder
Hello All Particularly I would like to know if it is possible at all in D to invoke a class method transferred to a scope outside the class as an alias argument. Regards - Puneet

AST Macros?

2012-06-01 Thread d coder
Greetings I know there is a plan for D to have AST macros eventually. I wanted to know if it is a feature being worked upon at this point of time. Approximately how long it would be before AST Macros see the light of the day in D? I know D is an opensource project and I am not trying to put any p

Re: Website

2012-06-01 Thread d coder
dlang.org is back. By the way, is there a PDF version of "D Programming Language Specification" which is available from Amazon as a kindle edition. It should be useful to have access to such a manual if the website goes down again. Regards - Puneet

Website

2012-05-31 Thread d coder
Why am I being taken to "Digital Daemon" when I goto http://dlang.org ? Where can I find official D language site now? Regards - Puneet

Calling an alias for a Class method in another scope

2012-05-31 Thread d coder
Greetings Kindly make me understand this. I have been trying to call an alias for a class method from another scope. I keep getting an error saying that I need "this" to call a method. Why will not "this" pointer be available when I am passing the method symbol along with an object of the class? I

Re: CTFE slower than expected

2012-05-29 Thread d coder
> > > Alright, well I've got a case of beer with your name on it if you can pull > it off! ;) > +1. I too am waiting for CTFE improvements. I am working on a DSL and with the present limitations, it is impractically slow and memory consuming while compiling.

Re: Lexer and parser generators using CTFE

2012-05-27 Thread d coder
> > I would like the parser to effect some side effects. For this purpose, I > tried including the parser mixin into a class, but I got a strange error > saying: > > Error: need 'this' to access member parse > > Ok. I see my folly. At compile time, there would not be any "this" since the class has

Re: Lexer and parser generators using CTFE

2012-05-27 Thread d coder
> > > Generally a parser generated by other tool and accepting tokens returns > the abstract syntax tree, but it return the evaluated value in the example. > In other words, it does lexical analysis, parsing and (type) converting at > a time. > If you want simply abstract syntax tree, it may be a l

Re: Pegged and DMD Compilation Memory

2012-05-23 Thread d coder
> But that might still not be enough Some 50-100MB additional memory is getting consumed by the compiler each time I parse a simple expression like "foo > 32;". In the end, if I parse 20 such expressions, the memory usage tops 2GB even while using asModule. Regards - Puneet

Re: Pegged and DMD Compilation Memory

2012-05-23 Thread d coder
> Have you guys tried to use asModule? > https://github.com/PhilippeSigaud/Pegged/wiki/Grammars-as-D-Modules > Thanks for the idea. I just gave it a try and the memory came down by about 50%. Additionally the compilation became much faster. But that might still not be enough :-( I will try to sim

Re: Pegged and DMD Compilation Memory

2012-05-23 Thread d coder
> dmd simply never frees any memory it allocates. Since GDC uses DMD front-end, I do not think I can get any relief by using that too. Right?

Pegged and DMD Compilation Memory

2012-05-23 Thread d coder
Greetings I am trying to use Pegged for compile time parsing. The only issue I am facing is with the compile time memory. I have a rather simple grammar, mostly derived from the arithmetic.d example that comes bundled with Pegged. I am wondering if the memory could be optimized by fine-tuning the

Re: String mixin syntax sugar

2012-03-20 Thread d coder
> Use template mixins? At least in struct/class area that catches the most > attention it should work perfectly. I believe template mixins are equally ugly. Don't you have to explicitly specify that you are invoking a mixin? Or am I missing something here. Regards - Puneet

Re: Compile Time D Expression Parser?

2012-03-11 Thread d coder
> Pegged should have no problem parsing all of D, at least theoretically (I > don't know of any severe ambiguities in D). So IOW, it can probably do > what you need it to do. Oh. I realized that I had missed Pegged announcement by Philippe. I will have a look at it. Regards - Puneet

Re: Compile Time D Expression Parser?

2012-03-11 Thread d coder
Hello Philippe > OK, doing a bit of thread necromancy here (3 weeks, still acceptable here?) > You are more than welcome. I am still working on the stuff. > Puneet, I might have something for you. IIUC, you want to parse > expressions that are > > - an association of boolean expressions (&&, ||

Re: Lexer and parser generators using CTFE

2012-02-29 Thread d coder
> > > This sounds like something I ran into in my D lexer project. Lexing > Phobos took upwards of 10-15 seconds, which is extremely slow > considering that dmd can *compile* it in just a few seconds. So I did > some profiling, and found out that most of the time was spent formatting > tokens into

Re: Lexer and parser generators using CTFE

2012-02-29 Thread d coder
> > I'm afraid being in holidays right now means I do not have easy access to > GitHub (no git on a pad, and the computer I use to code right now does not > have any network connection). I'll put all this online in a few days, > because that must seems like the ramblings of a madman right now... >

Re: Lexer and parser generators using CTFE

2012-02-28 Thread d coder
> > > > On Wednesday, February 29, 2012 02:16:12 Christopher Bergqvist wrote: > > > I agree that the current direction of D in this area is impressive. > > > However, I fail to see a killer-feature in generating a lexer-parser > > > generator at compile-time instead of run-time. > > > > CTFE parsi

Re: Compile Time D Expression Parser?

2012-02-27 Thread d coder
> > > Parsing method which the generated parser employs is Recursive Descent > Parsing. > And the behavior of the parsers recursive and A is a little bit > complicated. > The parser recursive matches the sequence of 'a' whose length is 2^n-1 > such as 1, 3, 7 and 15. > Anyway, I'm going to write mo

Re: Compile Time D Expression Parser?

2012-02-26 Thread d coder
> > > I know. CTFE is flexible enough and implementing this would be quite > simple. However, if ctpg serves your needs well, just use that. > Thanks Timon You mean I do not need to use function style when using CTFE? I will try parsing myself as you suggested. This approach would give me a b

Re: Compile Time D Expression Parser?

2012-02-26 Thread d coder
> > > Operator precedence parsers are simple to implement: > > http://effbot.org/zone/simple-**top-down-parsing.htm > Timon I want to do all this parsing at compile time in D (using mixins). I have just started working on this. I am not sure if

Re: Compile Time D Expression Parser?

2012-02-26 Thread d coder
> Hisayuki Mima's ctpg is compile-time parser generater, and the > generated parser works in compile time! > https://github.com/youkei/ctpg > > Kenji Hara > Thanks Kenji This is very interesting. Also I think ctpg is being actively developed. I will try to figure out how to make use of it. Regar

Re: Compile Time D Expression Parser?

2012-02-26 Thread d coder
> > How different is what you want to do from CTFE? > http://dlang.org/function.html I do not want to evaluate the expression in the string at compile time. I want to parse it at compile time and later at run time, I am required to process the parse tree and evaluate it in a different fashion (us

Compile Time D Expression Parser?

2012-02-25 Thread d coder
Greetings I need to parse simple D expressions at compile time. I was wondering if somebody on the list has some example code that could be of help to me. I am working on an opensource constraint solver and expressions that I need to parse can be reasonably complex such as "x + y*n < 32 && x > 4

Re: d future or plans for d3

2012-01-03 Thread d coder
> > > D's pass-down lambdas do not need memory allocation. As far as I remember > none of std.algorithm's use of lambda allocates memory. > > On that front Andrei, did you get a chance to discuss my request to make std.algorithm more usable with Walter? http://www.digitalmars.com/webnews/newsgro

Re: Garbage collection book

2011-10-10 Thread d coder
> > > The books have different authors. I don't suppose someone has both and can > comment on the differences? I have the older version as well, but wouldn't > mind picking up this new one if it brings enough new stuff to the table. Perhaps you can take a look at the ToC here http://www.amazon.

Re: function literals cannot be class members

2011-09-23 Thread d coder
On Mon, Jul 18, 2011 at 8:18 PM, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: [snip..] > We need to keep this key strategic advantage. First off, the fact that this > code isn't accepted: > > > BinaryHeap!(uint[], function (a, b) {return a > b;}) heap; > > is a clear bug. > > > Wo

Re: D in the TIOBE top

2011-09-09 Thread d coder
>From the Article > Wikipedia gives a hint about the comeback of D: "The release of Andrei > Alexandrescu's book 'The D Programming Language' on June 12, 2010 marked the > stabilization of D 2.0." In the charts we can see that the D language is > gradually rising again since that date. Sh

Re: Overloading comparison and Equality Operators

2011-09-06 Thread d coder
> Actually not expression templates. I am porting a BDD (Binary decision > diagrams) library from C++ to D. The comparison operators are just > implemented as relations that return another BDD. A BDD would then > evaluate to 0 or 1 depending on many other factors and other BDDs. A > BDD actually re

Re: Overloading comparison and Equality Operators

2011-09-06 Thread d coder
>>> For example a < b is re-written as a.opCmp(b) < 0. >>> In my application, I wanted to overload comparison and equality >>> operators to return user defined values. Is that possible in D? If so >>> how? >> >> What are you trying to do? >> In the end opCmp can return any value or object that work

Overloading comparison and Equality Operators

2011-09-06 Thread d coder
Greetings It seems D assumes that these operators should return a bool value. For example a < b is re-written as a.​opCmp(b) < 0. In my application, I wanted to overload comparison and equality operators to return user defined values. Is that possible in D? If so how? Regards - Puneet

Re: Mixin template evaluated to string can convert to string mixin expression implicitly

2011-08-21 Thread d coder
On Mon, Jun 27, 2011 at 2:09 PM, Don wrote: > kenji hara wrote: > >> Issue in bugzilla: >> >> http://d.puremagic.com/issues/**show_bug.cgi?id=6207 >> Test implementation: >> https://github.com/9rnsr/dmd/**commit/**52e4491cf6bf9ccf6dccc1fa6058

  1   2   >