Re: Source code annotations alla Java

2011-01-20 Thread Justin Johansson
On 21/01/11 01:02, Steven Schveighoffer wrote: On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson wrote: Not long ago the Java Language people introduced the idea of annotations together with an annotation processing tool (apt). Now perhaps the idea of source code annotations is not

Re: Source code annotations alla Java

2011-01-20 Thread Justin Johansson
On 21/01/11 00:47, Justin Johansson wrote: Not long ago the Java Language people introduced the idea of annotations together with an annotation processing tool (apt). Now perhaps the idea of source code annotations is not actually a Java invention per se, however for someone learning D is there

Source code annotations alla Java

2011-01-20 Thread Justin Johansson
Not long ago the Java Language people introduced the idea of annotations together with an annotation processing tool (apt). Now perhaps the idea of source code annotations is not actually a Java invention per se, however for someone learning D is there any equivalent idiom [of Java annotations

Re: asserts in debug and release code

2009-11-04 Thread Justin Johansson
BCS Wrote: > Hello Justin, > > > With respect to the dmd -release compiler switch, > > are assert statements meant to be compiled in release code? > > Whilst the D1 spec says "The compiler may optionally not evaluate > > assert expressions at all.", > > my intuition suggests that asserts would/sh

asserts in debug and release code

2009-11-04 Thread Justin Johansson
bug assert(cond); Lastly, will assert/switch behaviour change in D2? Thanks for all help, Justin Johansson

Re: Associative array trouble

2009-10-16 Thread Justin Johansson
Bill Baxter Wrote: > You query presence of a key in an AA using 'in' Thank you Bill .. esp. the tip to avoid double lookup. JJ

Associative array trouble

2009-10-16 Thread Justin Johansson
What's wrong with this simple symbol table class? class Symbol { private char[] id; private static Symbol[char[]] symtab; private this( string id) { this.id = id; } static Symbol opCall( char[] id) { Symbol sym = symtab[id]; // *** ArrayBoundsError here if (sym

Installing D1 and D2 side by side on linux

2009-10-14 Thread Justin Johansson
: not found So what's the best way to do a side-by-side install of D1 and D2 on linux? As usual, thanks for all kind assistance, -- Justin Johansson

Re: Should I compare pointers with is of == ?

2009-10-14 Thread Justin Johansson
Max Samukha Wrote: > On Wed, 14 Oct 2009 14:20:24 -0400, Justin Johansson > wrote: > > >#ponce Wrote: > > > >> It's a bit unclear to me. > >> > >> I know I must compare references with is but pointers ? > > > >Thanks fo

Re: Should I compare pointers with is of == ?

2009-10-14 Thread Justin Johansson
#ponce Wrote: > It's a bit unclear to me. > > I know I must compare references with is but pointers ? Thanks for asking this question ponce; I've been getting into the habit of using 'is' for both pointers and classes, so in similar vein to ponce's question, I'd like to ask if the following (

Embedding a DSL into D source

2009-10-12 Thread Justin Johansson
one D source module and just run with that .. though the idea of actually embedding directly into D does have some real appeal (at least to me). Hope this makes sense and, as usual, thanks for all help, -- Justin Johansson

Re: How initialize a static rectangular array (2-d matrix)

2009-10-08 Thread Justin Johansson
Jarrett Billingsley Wrote: > On Thu, Oct 8, 2009 at 8:10 PM, Justin Johansson wrote: > > I almost have to apologize for this question but .. > > > > How does one initialize a static rectangular array (2-d matrix) in D1? > > > > None of the following or other v

Re: How initialize a static rectangular array (2-d matrix)

2009-10-08 Thread Justin Johansson
Jarrett Billingsley Wrote: > On Thu, Oct 8, 2009 at 8:10 PM, Justin Johansson wrote: > > I almost have to apologize for this question but .. > > > > How does one initialize a static rectangular array (2-d matrix) in D1? > > > > None of the following or other v

How initialize a static rectangular array (2-d matrix)

2009-10-08 Thread Justin Johansson
I almost have to apologize for this question but .. How does one initialize a static rectangular array (2-d matrix) in D1? None of the following or other variations that I've tried compile with DMD 1.0. int[2, 3] matrix = [ 1, 2, 3, 4, 5, 6 ]; int[2, 3] matrix = [[ 1, 2, 3 ], [ 4, 5, 6 ]];

Re: Getting started - D meta-program question

2009-10-04 Thread Justin Johansson
downs Wrote: > Justin Johansson wrote: > > Daniel Keep Wrote: > > > > Just now I've written a bit of CS101 play around code (shown below) for > > constructing a > > singly-linked list of numbers (Conslist idiom). As the code seems to work, > > it

Re: Sizeof class instance

2009-10-04 Thread Justin Johansson
grauzone Wrote: > Justin Johansson wrote: > > How does one determine the sizeof (in bytes) of an instance of a class in D? > > > > .sizeof works as advertised for structs, but for reference types, > > .sizeof yields the sizeof the referencing variable (effectively sam

Re: Sizeof class instance

2009-10-04 Thread Justin Johansson
Jeremie Pelletier Wrote: > Justin Johansson wrote: > > Jarrett Billingsley Wrote: > > > >> On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson wrote: > >>> How does one determine the sizeof (in bytes) of an instance of a class in > >>> D? > >

Re: Getting started - D meta-program question

2009-10-03 Thread Justin Johansson
Daniel Keep Wrote: > Justin Johansson wrote: > > There was mention** on the general discussion group that the D > > foreach_reverse > > language construct could be replaced (emulated?) with a (D) meta-program. > > > > ** "Even a novice programm

Getting started - D meta-program question

2009-10-03 Thread Justin Johansson
There was mention** on the general discussion group that the D foreach_reverse language construct could be replaced (emulated?) with a (D) meta-program. ** "Even a novice programmer can write a meta-program to replace foreach_reverse without any runtime performance hit." http://www.digitalmar

Re: Sizeof class instance

2009-10-03 Thread Justin Johansson
Jeremie Pelletier Wrote: > Justin Johansson wrote: > > Jarrett Billingsley Wrote: > > > >> On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson wrote: > >>> How does one determine the sizeof (in bytes) of an instance of a class in > >>> D? > >

Re: Sizeof class instance

2009-10-03 Thread Justin Johansson
Jarrett Billingsley Wrote: > On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson wrote: > > How does one determine the sizeof (in bytes) of an instance of a class in D? > > > > .sizeof works as advertised for structs, but for reference types, > > .sizeof yields the size

Sizeof class instance

2009-10-03 Thread Justin Johansson
How does one determine the sizeof (in bytes) of an instance of a class in D? .sizeof works as advertised for structs, but for reference types, .sizeof yields the sizeof the referencing variable (effectively same as size of a pointer) and not the size of the underlying instance. I did try scannin