D language have like Pascal/Delphi "with statement", which very
useful for writing readable code.
http://dlang.org/statement.html#WithStatement
Maybe I'm wrong, but, I never saw where using this statement in
phobos source codes, what problem using this statement?
Regards,
Khurshid.
On Sunday, June 09, 2013 12:11:23 khurshid wrote:
> D language have like Pascal/Delphi "with statement", which very
> useful for writing readable code.
>
> http://dlang.org/statement.html#WithStatement
>
> Maybe I'm wrong, but, I never saw where using this statement in
> phobos source codes,
khurshid:
D language have like Pascal/Delphi "with statement", which
very useful for writing readable code.
It's a quite useful statement, especially with enumerations or
associative array literals, to avoid repeating many times their
name:
switch (en) with (MyEnum) {
case foo: ...
c
On Sunday, 9 June 2013 at 10:22:22 UTC, Jonathan M Davis wrote:
On Sunday, June 09, 2013 12:11:23 khurshid wrote:
D language have like Pascal/Delphi "with statement", which
very
useful for writing readable code.
http://dlang.org/statement.html#WithStatement
Maybe I'm wrong, but, I never saw
On Sunday, 9 June 2013 at 10:22:22 UTC, Jonathan M Davis wrote:
On Sunday, June 09, 2013 12:11:23 khurshid wrote:
D language have like Pascal/Delphi "with statement", which
very
useful for writing readable code.
http://dlang.org/statement.html#WithStatement
Maybe I'm wrong, but, I never saw
mike james:
Even Wirth gave up on the "with" statement in his later
languages design.
I think he was trying to remove all the not essential features
from the design of its language, to produce something essential.
I prefer a language that has more handy things, even if they are
not strictly
On 6/9/13, bearophile wrote:
> It's a quite useful statement, especially with enumerations or
> associative array literals, to avoid repeating many times their
> name:
>
> switch (en) with (MyEnum) {
>case foo: ...
>case bar: ...
> }
Yep, I use this idiom a lot. It's also very useful in u
On Sunday, 9 June 2013 at 10:22:22 UTC, Jonathan M Davis wrote:
On Sunday, June 09, 2013 12:11:23 khurshid wrote:
D language have like Pascal/Delphi "with statement", which
very
useful for writing readable code.
http://dlang.org/statement.html#WithStatement
Maybe I'm wrong, but, I never saw
On Sunday, 9 June 2013 at 11:56:42 UTC, Andrej Mitrovic wrote:
There are some bugs with it currently, but I think they're
fixable.
Currently, "with" does not look into "alias this" members which
somewhat limits its usefulness:
http://d.puremagic.com/issues/show_bug.cgi?id=6711
http://d.purem
On Sunday, 9 June 2013 at 11:11:47 UTC, bearophile wrote:
khurshid:
D language have like Pascal/Delphi "with statement", which
very useful for writing readable code.
It's a quite useful statement, especially with enumerations or
associative array literals, to avoid repeating many times the
On Sun, 09 Jun 2013 20:09:31 +0200
"deadalnix" wrote:
>
> switch(foobar) with(FoobarEnum) {
> // ...
> }
>
> That is golden !
Oooh! That's a good one! I don't think I've ever used "with" in any
language before (never saw much point), but I probably will start using
that.
On Sunday, 9 June 2013 at 19:03:12 UTC, khurshid wrote:
On Sunday, 9 June 2013 at 11:11:47 UTC, bearophile wrote:
khurshid:
D language have like Pascal/Delphi "with statement", which
very useful for writing readable code.
It's a quite useful statement, especially with enumerations or
asso
On 06/09/2013 11:09 AM, deadalnix wrote:
> On Sunday, 9 June 2013 at 10:22:22 UTC, Jonathan M Davis wrote:
>> I'd argue that it would make code harder to read, because it hides where
>> the variables are coming from.
+1. A friend of mine is "still experimenting" with 'with' and I hate
reading
On Sunday, 9 June 2013 at 23:48:39 UTC, Ali Çehreli wrote:
On 06/09/2013 11:09 AM, deadalnix wrote:
> On Sunday, 9 June 2013 at 10:22:22 UTC, Jonathan M Davis
wrote:
>> I'd argue that it would make code harder to read, because it
hides where
>> the variables are coming from.
+1. A friend of mi
On 2013-06-09 20:09, deadalnix wrote:
switch(foobar) with(FoobarEnum) {
// ...
}
That is golden !
I agree, that's basically the only case I've used "with" for.
--
/Jacob Carlborg
Am Sun, 09 Jun 2013 16:48:39 -0700
schrieb Ali Çehreli :
> > switch(foobar) with(FoobarEnum) {
> > // ...
> > }
> >
> > That is golden !
>
> +1000 :o)
>
> To me, 'with' is useful only in that _case_.
Pun intended?
I even remember someone being surprised that it had other uses
than th
On Sunday, 9 June 2013 at 10:11:25 UTC, khurshid wrote:
D language have like Pascal/Delphi "with statement", which
very useful for writing readable code.
http://dlang.org/statement.html#WithStatement
Maybe I'm wrong, but, I never saw where using this statement
in phobos source codes, what
09.06.2013 14:11, khurshid пишет:
D language have like Pascal/Delphi "with statement", which very useful
for writing readable code.
http://dlang.org/statement.html#WithStatement
Maybe I'm wrong, but, I never saw where using this statement in phobos
source codes, what problem using this state
On 06/10/2013 02:43 AM, Marco Leise wrote:
> Am Sun, 09 Jun 2013 16:48:39 -0700
> schrieb Ali Çehreli :
>
>> > switch(foobar) with(FoobarEnum) {
>> > // ...
>> > }
>> To me, 'with' is useful only in that _case_.
>
> Pun intended?
Ha ha! :) No, I missed that one.
Ali
On Sun, 09 Jun 2013 14:09:31 -0400, deadalnix wrote:
On Sunday, 9 June 2013 at 10:22:22 UTC, Jonathan M Davis wrote:
On Sunday, June 09, 2013 12:11:23 khurshid wrote:
D language have like Pascal/Delphi "with statement", which very
useful for writing readable code.
http://dlang.org/statemen
On Mon, 10 Jun 2013 15:33:44 +0200
"Anthony Goins" wrote:
>
> Am I the only one that found this useful?
> Is there a better way?
>
> with (specificModule)
> {
> result = ufcsChain.ambiguousFunction.link3();
> }
Ooh, that's another good one!
On Sunday, 9 June 2013 at 10:11:25 UTC, khurshid wrote:
D language have like Pascal/Delphi "with statement", which
very useful for writing readable code.
http://dlang.org/statement.html#WithStatement
Maybe I'm wrong, but, I never saw where using this statement
in phobos source codes, what
22 matches
Mail list logo