Re: Dynamic language

2012-03-15 Thread J Arrizza
Ruby, hands down. - Strong OO language. I believe it was partially based on smalltalk. - The Object model is very well done, every thing is a first-class object. - Meta-programming is easy to do - has good support in IDEs like eclipse and RubyMine - the gem library is huge and comprehensive -

Re: killer App for D? (was: State of D on iOS/Android)

2012-02-03 Thread J Arrizza
On Thu, Feb 2, 2012 at 7:18 AM, Iain Buclaw ibuc...@ubuntu.com wrote: On 2 February 2012 14:50, J Arrizza cppge...@gmail.com wrote: So... Will D and Android GUI libraries be able to replace Java in the next two years? Is there a commitment or direction towards that end? Not replace

Re: killer App for D? (was: State of D on iOS/Android)

2012-02-02 Thread J Arrizza
On Sun, Jan 29, 2012 at 4:26 PM, J Arrizza cppge...@gmail.com wrote: So another, better, question: Do you -- we -- want to make D a popular language or not? If not, that implies one set of development and architectural strategies. If yes, it implies another set. The two sets have some

Re: killer App for D? (was: State of D on iOS/Android)

2012-01-29 Thread J Arrizza
On Sat, Jan 28, 2012 at 6:02 PM, Alex Rønne Petersen xtzgzo...@gmail.comwrote: In fact, D already runs on Android if you do some tweaks to the GDC build. I've managed to get D apps running on both a Galaxy Tab 10.1 and an Efika MX. I think that's pushing it. I see no reason to include

killer App for D? (was: State of D on iOS/Android)

2012-01-28 Thread J Arrizza
As far as I know, gdc can already produce ARM code since it uses the gcc backend. All we need now is a nice native D interface to the Android libraries, and I'll be a very very happy man. Isn't this the killer app for D (like ROR for Ruby, etc.) ? There was a thread a while ago where

Re: The God Language

2012-01-03 Thread J Arrizza
On Tue, Jan 3, 2012 at 2:36 AM, maarten van damme maartenvd1...@gmail.comwrote: there is no destruction/creation going on, energy is constant at all times in a closed system. That's how I thought about it :) If it's constant anyway he wouldn't have to bother with a gc, would he? I see.

Re: The God Language

2012-01-02 Thread J Arrizza
and I'm pretty sure there is no garbage collector included in gods language :p Are you sure? There is good evidence he strongly prefers gc's. Consider almost all insects; consider dung beetles specifically. Consider super novas, gravity and accretion disks. Consider Disney and the Circle of

Re: Java Scala

2011-12-20 Thread J Arrizza
On Mon, Dec 19, 2011 at 12:48 PM, Walter Bright newshou...@digitalmars.comwrote: On 12/19/2011 11:52 AM, ddverne wrote: On Sunday, 18 December 2011 at 07:09:21 UTC, Walter Bright wrote: A programmer who doesn't know assembler is never going to write better than second rate programs.

Re: Java Scala

2011-12-20 Thread J Arrizza
On Tue, Dec 20, 2011 at 11:18 AM, Walter Bright I don't agree, as I had been programming for two years before I learned assembler. My high level code made dramatic improvements after that. It's not my style to pass out compliments, but, well, hey, you can't really use yourself as a typical

Re: Package manager - interacting with the compiler

2011-12-10 Thread J Arrizza
Jacob, On Sat, Dec 10, 2011 at 12:55 AM, Jacob Carlborg d...@me.com wrote: Currently I see two use cases: 1. When the package manager installs (and builds) a package This will have to handle cross-compilations and multiple build variants per platform. Multiple platforms are needed

Re: Package manager - interacting with the compiler

2011-12-10 Thread J Arrizza
A few other potential twists. - the installation step needs to be portable int that can install the variant build artifacts into non-standard file system locations. For example, the build artifacts for the windows build and the build artifacts for the linux build need to end up in separate

Re: goto case warning

2011-11-13 Thread J Arrizza
I've been trying some other mods of this and it looks like it's somehow related to imports of files from another directory. First, I went back to a working version which still works. Then I did a couple of tests: 1) split off the two classes that used the Variant class. Still worked ok. That is:

goto case warning

2011-11-12 Thread J Arrizza
I'm getting an odd error message in line 366 below (this is part of variant.d): ../utd/variant.d(366): Error: switch case fallthrough - use 'goto case;' if intended But you can see that line 366 already has a goto case: switch(id) { foreach(i,T; ICT!A ) {

Re: Python vs D [ was Re: Bartosz about Chapel ]

2011-11-11 Thread J Arrizza
On Fri, Nov 11, 2011 at 1:29 AM, Russel Winder rus...@russel.org.uk wrote: Paulo, with respect, I disagree. A single killer feature does not have enough breadth to entice a developer community that has large and varied needs from a language. But in developing the reputation it is critical

Re: Python vs D [ was Re: Bartosz about Chapel ]

2011-11-11 Thread J Arrizza
On Fri, Nov 11, 2011 at 1:37 PM, Danni Coy danni@gmail.com wrote: Isn't that more or less what Wayland is (minus the D bit)? I am pretty sure that Qt,Gtk and there respective D bindings will run on top of it. Perhaps it is. Unfortunately I may have muddied the waters a little. My point

Re: Python vs D [ was Re: Bartosz about Chapel ]

2011-11-10 Thread J Arrizza
True but somehow they manage to become famous because there was a killer feature everyone wanted to use. If I recall correctly: Perl - An easy way to create complex shell scripts and the major language to be used for web development (CGI) Ruby - It only took off because Ruby on Rails

Re: typeid of surrounding class from a static function?

2011-11-06 Thread J Arrizza
On Sun, Nov 6, 2011 at 9:14 AM, Alex Rønne Petersen xtzgzo...@gmail.comwrote: Considering the class is statically known, typeid(SomeClass)? - Alex Sorry, my simplified example simplified too far. I'd like to put the call into a mixin template or template, so hard-coding the class name is

Re: Introspection/Reflection/etc on Linux

2011-11-04 Thread J Arrizza
And here's a working example: import std.stdio; import variant; import std.string; import std.conv; // class Base { private int y; //check if a variable causes any problems //run all member functions that start with in public void RunAllIn(alias T) () {

Re: Introspection/Reflection/etc on Linux

2011-11-04 Thread J Arrizza
On Mon, Oct 24, 2011 at 12:47 AM, Jacob Carlborg d...@me.com wrote: You can foreach over ModuleInfo and access the classes using localClasses. Have a look at the implementation of object.TypeInfo_Class.find in druntime. -- /Jacob Carlborg And here is the last piece of the puzzle: void

Re: Introspection/Reflection/etc on Linux

2011-11-03 Thread J Arrizza
mentioned below. Neither patch seems to address retro() or Result... John On Wed, Nov 2, 2011 at 6:43 AM, Robert Jacques sandf...@jhu.edu wrote: On Tue, 01 Nov 2011 14:42:42 -0400, J Arrizza cppge...@gmail.com wrote: Robert, I tried using variant.d using your exact test program below

Re: Introspection/Reflection/etc on Linux

2011-11-03 Thread J Arrizza
PS, this version works and prints 10 for the length: string id = somestring; auto rid = retro(id); //writeln(rid.length); writeln(rid.source.length); On Thu, Nov 3, 2011 at 3:26 AM, J Arrizza cppge...@gmail.com wrote: Robert, This stub shows the issue: import std.stdio

Re: Introspection/Reflection/etc on Linux

2011-11-03 Thread J Arrizza
Here's my changes to it: //Convert a string representation of a type, produced by typeinfo into a .stringof representation string typeinfo2stringof(string id){ auto rid = retro(id); auto r1 = find(rid, '.'); auto rb = find(rid, '!'); auto r1len =

Re: Introspection/Reflection/etc on Linux

2011-11-01 Thread J Arrizza
Robert, I tried using variant.d using your exact test program below and I got compiler errors: $ dmd variant.d dtest.d variant.d(273): Error: no property 'length' for type 'Result' variant.d(273): Error: no property 'length' for type 'Result' variant.d(274): Error: no property 'length' for type

Re: template specialization for arrays

2011-11-01 Thread J Arrizza
the [N] and then goes on to specify that N is a size_t. John On Mon, Oct 31, 2011 at 5:13 AM, Steven Schveighoffer schvei...@yahoo.comwrote: On Sat, 29 Oct 2011 12:11:42 -0400, J Arrizza cppge...@gmail.com wrote: Thanks for the reply Jonathan, but it didn't work for me: void abc(T) (T

Re: queue container?

2011-11-01 Thread J Arrizza
On Mon, Oct 31, 2011 at 7:07 AM, Steven Schveighoffer schvei...@yahoo.comwrote: I personally guarantee that dcollections will persist as long as std.container's design is not modified to become like dcollections'. Simply because I need it for my projects :) And I'm not going to some other

Re: template specialization for arrays

2011-10-30 Thread J Arrizza
You should use either std.traits.isXxx systematically, or patterns systematically, but not both at the same time. Personally I prefer isXxx because they foster simple logic to decide what overloads should apply. Also, when posting, you may want to include complete short programs so others

Re: template specialization for arrays

2011-10-30 Thread J Arrizza
On Sun, Oct 30, 2011 at 3:13 AM, Timon Gehr timon.g...@gmx.ch wrote: What compiler version are you using? $ dmd -v DMD64 D Compiler v2.055

Re: template specialization for arrays

2011-10-30 Thread J Arrizza
On Sun, Oct 30, 2011 at 7:36 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: The code as above is canonical. I think restricted templates are the way to go for most code. Yes, they are much simpler to use. I went back to traits.d to see how isDynamicArray and isStaticArray were

template specialization for arrays

2011-10-29 Thread J Arrizza
I have a template that I'd like to have a specialization for arrays. Initiall I need it to work for byte arrays, but I'd like to make it eventually work for all arrays. The page http://d-programming-language.org/template says to use template TFoo(T : T[]) { ... } // #2 but when I try it, it

Re: queue container?

2011-10-29 Thread J Arrizza
On Fri, Oct 28, 2011 at 6:55 PM, Steven Schveighoffer schvei...@yahoo.comwrote: Using an array of any type as a queue is going to be awkward. Yes. The call is messy and of course I could wrap it in my own class to make the calling syntax cleaner. My application is not performance critical in

Re: template specialization for arrays

2011-10-29 Thread J Arrizza
] John On Sat, Oct 29, 2011 at 8:41 AM, Jonathan M Davis jmdavisp...@gmx.comwrote: On Saturday, October 29, 2011 08:24:29 J Arrizza wrote: I have a template that I'd like to have a specialization for arrays. Initiall I need it to work for byte arrays, but I'd like to make it eventually

Re: template specialization for arrays

2011-10-29 Thread J Arrizza
of all sorts. On Sat, Oct 29, 2011 at 8:11 PM, J Arrizza cppge...@gmail.com wrote: Thanks for the reply Jonathan, but it didn't work for me: void abc(T) (T[] parm1) if (isDynamicArray!T) { writeln(array : , parm1); } Nor did: void abc(T) (T[] parm1) if (isStaticArray!T

Re: template specialization for arrays

2011-10-29 Thread J Arrizza
When using pattern matching, explicit template arguments are necessary. You probably don't want that, the following code does not need them: void abc(T)(T parm1) if(!isDynamicArray!T) { writeln(simpleparm: , parm1); } void abc(T)(T parm1) if(isDynamicArray!T){ writeln(array : ,

Re: template specialization for arrays

2011-10-29 Thread J Arrizza
Thank you Timon, I very much appreciate your (and others) help. I will look all this up in the online docs and the book. There is still some very odd things in how these fit together. For example, if I comment out the last 3 function templates, I get all simpleparms, which is expected. But if

Re: template specialization for arrays

2011-10-29 Thread J Arrizza
On Sat, Oct 29, 2011 at 4:14 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: What's wrong with isStaticArray? Also, OP may want to look at isNarrowString. Andrei Tried isStaticArray: void abc(T:U[], U) (T parm1) if (isDynamicArray!T) { writeln(dynamic array : ,

Re: template specialization for arrays

2011-10-29 Thread J Arrizza
On Sat, Oct 29, 2011 at 5:16 PM, Jonathan M Davis jmdavisp...@gmx.comwrote: and get compiler ambiguity for abc(str) between the two templates above. Of course you do. A narrow string is a dynamic array, so it matches both. You need to change the second constraint to if(isDynamicArray!T

Re: queue container?

2011-10-27 Thread J Arrizza
Just curious, could a Facet be used to implement lock/no lock relatively easily. (BTW, as great as this thread has gone, I was wondering if someone could answer my original question about using existing Array container for a queue?) On Thu, Oct 27, 2011 at 11:06 AM, Martin Nowak d...@dawgfoto.de

queue container?

2011-10-25 Thread J Arrizza
I need a Queue (put on the front and pop from the back). The best I can come up with so far is: Array!string list; list.insertBack(a1); list.insertBefore(list.opSlice(0,1), a2); list.insertBefore(list.opSlice(0,1), a3); list.insertBefore(list.opSlice(0,1), a4);

Re: Introspection/Reflection/etc on Linux

2011-10-23 Thread J Arrizza
sandf...@jhu.edu wrote: On Sat, 22 Oct 2011 21:17:09 -0400, J Arrizza cppge...@gmail.com wrote: This would be easier with stringify: register(bob, #bob); Anything like that in D? John What do you mean by stringify? Wouldn't register!bob be superior?

Re: Introspection/Reflection/etc on Linux

2011-10-23 Thread J Arrizza
:09 -0400, J Arrizza cppge...@gmail.com wrote: This would be easier with stringify: register(bob, #bob); Anything like that in D? John What do you mean by stringify? Wouldn't register!bob be superior?

Re: Introspection/Reflection/etc on Linux

2011-10-23 Thread J Arrizza
don't have to new Bob() Thanks for everyone's help, John On Sun, Oct 23, 2011 at 9:21 AM, Robert Jacques sandf...@jhu.edu wrote: On Sun, 23 Oct 2011 02:59:48 -0400, J Arrizza cppge...@gmail.com wrote: The idea here was to create a base class. That base class would have a function register

Re: Introspection/Reflection/etc on Linux

2011-10-23 Thread J Arrizza
Jacob, by the way, I did try flectioned and unfortunately it failed to compile. http://flectioned.kuehne.cn/ According to the comments it should work in windows or linux and it should work with D1 and D2. However I got quite a few compiler errors using: $ dmd -v DMD64 D Compiler

Re: Introspection/Reflection/etc on Linux

2011-10-22 Thread J Arrizza
, replacing the context pointer with the specified object. On Tue, Oct 18, 2011 at 8:48 PM, J Arrizza cppge...@gmail.com wrote: I'm trying to write some sample code to: 1 create an object via it's name 2 search an object for it's functions 3 call a static function in a class 4

Re: typeof()

2011-10-22 Thread J Arrizza
Thanks. I tried typeid vs typeof and as you pointed out the runtime vs compile time info isn't what I need. On Thu, Oct 20, 2011 at 6:55 AM, Steven Schveighoffer schvei...@yahoo.comwrote: On Thu, 20 Oct 2011 09:46:09 -0400, J Arrizza cppge...@gmail.com wrote: Maybe I'm doing something else

typeof()

2011-10-20 Thread J Arrizza
typeof returns the type of the object given to it: SomeClass sc; typeof(sc) // returns SomeClass Object o = sc; typeof(o) // returns Object Is there a way or call to get the underlying type?: typeof2(o) //returns SomeClass I checked the online doc, but nothing in the

Re: typeof()

2011-10-20 Thread J Arrizza
AM, Jens Mueller jens.k.muel...@gmx.dewrote: J Arrizza wrote: typeof returns the type of the object given to it: SomeClass sc; typeof(sc) // returns SomeClass Object o = sc; typeof(o) // returns Object Is there a way or call to get the underlying type

Re: Introspection/Reflection/etc on Linux

2011-10-19 Thread J Arrizza
Just noticed an odd thing when I was trying Jacob's code. This works great: auto x = new someClass(); Object o = x; void delegate() dg; foreach(i, m; __traits(derivedMembers, someClass)) { writeln(i=, i, m=, m); if(m != __ctor) {

Re: Introspection/Reflection/etc on Linux

2011-10-19 Thread J Arrizza
pg 386 of the book with opDispatch? If I can get it to work, I'll post a sample. On Tue, Oct 18, 2011 at 11:31 AM, Gor Gyolchanyan gor.f.gyolchan...@gmail.com wrote: You need to compile an associative array which maps the method names to method delegates and call those delegates, replacing

Re: Introspection/Reflection/etc on Linux

2011-10-19 Thread J Arrizza
Yup, didn't check for null, damn it. Can I blame it on working on it at 2:30AM? Forget the excuse, I just didn't check for null. For future reference, the fully qualified name for SomeClass is SomeClass.SomeClass. If I create class Bob in the SomeClass file SomeClass.Bob. The first node is the

Introspection/Reflection/etc on Linux

2011-10-18 Thread J Arrizza
I'm trying to write some sample code to: 1 create an object via it's name 2 search an object for it's functions 3 call a static function in a class 4 call a non-static function in an object #1, #2 and #3 were straightforward. But #4 looks like it's not possible in DMD 2.0. I found this:

Re: User packages/libs (Was: Just starting out)

2011-10-16 Thread J Arrizza
Jacob, That's great! I would like to work on this myself, it sounds like a great project, but my experience level right now is so low I'd most likely be the opposite of productive. Perhaps I can help out on the test side. Let me know if you want me to try anything out on Ubuntu 10.04. John On

Re: Just starting out

2011-10-13 Thread J Arrizza
with UltraEdit (great editor, got a life-time license for it). John On Wed, Oct 12, 2011 at 11:42 PM, Jacob Carlborg d...@me.com wrote: On 2011-10-13 01:43, J Arrizza wrote: Hi, I'm just starting out in D, read the book, tried a Hello World, and wrote a few unit tests. I'm ready for the next

Just starting out

2011-10-12 Thread J Arrizza
Hi, I'm just starting out in D, read the book, tried a Hello World, and wrote a few unit tests. I'm ready for the next step. I'd like to begin writing some more complex D code which I want to use not only as a test bed to investigate D itself to a deeper level but if it's successful to

Re: Paradox about D's popularity.

2011-09-21 Thread J Arrizza
All excellent points Gor. I'd like to point out that Java faced nearly the same issues (one difference is it had Sun backing it) and yet it overcame those hurdles. I believe it became as popular as it did because of the JDK, not because of the language itself. (I actually called v1.0 a toy

Re: Is there a CPAN, CheeseShop, Hackage or NPM for D?

2011-09-20 Thread J Arrizza
Please don't forget dependency on dmd1 vs dmd2... On Tue, Sep 20, 2011 at 9:54 AM, Jacob Carlborg d...@me.com wrote: On 2011-09-20 13:37, Chris Dew wrote: Hi Jacob, It's great to see that someone's working on this. Will your design cope with the situation as follows: ModA 1.0.0 requires

Re: Would You Bet $100,000,000 on D?

2011-09-17 Thread J Arrizza
Hmmm. If $100M was on the line, the project code base must be extremely large. Correct? With a code base of that size, more than half would be common or boilerplate functionality, e.g. read a config file, read a data file, write/update a file, parse the command line, maintain a list, put up a