Re: php strings demo

2010-11-23 Thread Graham Fawcett
On Sat, 20 Nov 2010 18:03:34 -0500, Kagamin wrote: > Adam D. Ruppe Wrote: > >> Meh, I find the placeholders to be much better (safer too): >> >> db.query("select id from objects where type = ?", typeName); > > I use it too, but found it hard to maintain/check ordering and meaning > of parameter

Re: php strings demo

2010-11-21 Thread Kagamin
Tomek Sowi�ski Wrote: > Dnia 20-11-2010 o 22:46:33 Kagamin napisa�(a): > > > See attachment. It's just a thought. Anyone want this in the language? > > --- > > string sval="ab128#d"; > > int ival=274; > > static assert("asdf \{sval} astt35 \{ival} zzf \{uuu} g,d" == > > "asdf ab128#d astt35

Re: php strings demo

2010-11-21 Thread Tomek Sowiński
Dnia 20-11-2010 o 22:46:33 Kagamin napisał(a): See attachment. It's just a thought. Anyone want this in the language? --- string sval="ab128#d"; int ival=274; static assert("asdf \{sval} astt35 \{ival} zzf \{uuu} g,d" == "asdf ab128#d astt35 274 zzf uuu g,d"); //(uuu not found) --- std.conv.t

Re: php strings demo

2010-11-21 Thread Nick Sabalausky
"Kagamin" wrote in message news:ic9fjp$1no...@digitalmars.com... > See attachment. It's just a thought. Anyone want this in the language? > --- > string sval="ab128#d"; > int ival=274; > static assert("asdf \{sval} astt35 \{ival} zzf \{uuu} g,d" == > "asdf ab128#d astt35 274 zzf uuu g,d"); //(uuu

Re: php strings demo

2010-11-20 Thread Kagamin
Adam D. Ruppe Wrote: > Meh, I find the placeholders to be much better (safer too): > > db.query("select id from objects where type = ?", typeName); It's also non-trivial to implement such functionality, since MS (and Oracle, afaik) require named parameters.

Re: php strings demo

2010-11-20 Thread Kagamin
Adam D. Ruppe Wrote: > Meh, I find the placeholders to be much better (safer too): > > db.query("select id from objects where type = ?", typeName); I use it too, but found it hard to maintain/check ordering and meaning of parameters when you edit the query, add or remove parameters.

Re: php strings demo

2010-11-20 Thread Adam D. Ruppe
Kagamin Wrote: > Wrote some unittests today and thought, this feature is useful when one wants easy sql statements (in, e.g. unittests). Meh, I find the placeholders to be much better (safer too): db.query("select id from objects where type = ?", typeName); I generally feel the same way about al

Re: php strings demo

2010-11-20 Thread Kagamin
Kagamin Wrote: > See attachment. It's just a thought. Anyone want this in the language? > --- > string sval="ab128#d"; > int ival=274; > static assert("asdf \{sval} astt35 \{ival} zzf \{uuu} g,d" == > "asdf ab128#d astt35 274 zzf uuu g,d"); //(uuu not found) > --- Wrote some unittests today and t

php strings demo

2010-11-20 Thread Kagamin
See attachment. It's just a thought. Anyone want this in the language? --- string sval="ab128#d"; int ival=274; static assert("asdf \{sval} astt35 \{ival} zzf \{uuu} g,d" == "asdf ab128#d astt35 274 zzf uuu g,d"); //(uuu not found) --- php.d Description: Binary data