bearophile:
> I see. I prefer to see a chunk of code that does something, on the > screen,
> and
to not scroll too much.
That's what functions are for!
> I meant something different. I don't want to convert JSON tree
> from-to text, I'd like to bypass the text representation fully.
Yes, that wo
On 02/09/2011 01:35 AM, bearophile wrote:
I meant something different. I don't want to convert JSON tree from-to text,
I'd like to bypass the text representation fully. So the compile-time JSON
Phobos library returns a data structure that represents the JSON tree (created
by the compiler) in m
On 02/08/2011 10:11 PM, bearophile wrote:
Adam Ruppe:
I'm still trying to find something I like for this.
Me too.
I like Adam's solution as well, but it's not perfect. The only other solution
(like for constraints) would be a syntactic difference, but since we're limited
by keyboard keys,
Adam D. Ruppe:
> I like it being thin so for me, it's a win/win.
> I use small and split windows as well as
> 8 character tab stops. (4 characters just blend into the background..)
I see. I prefer to see a chunk of code that does something, on the screen, and
to not scroll too much.
For lot of t
bearophile:
> I understand. But splitting lines too much make the code a bit
> too much thin.
I like it being thin so for me, it's a win/win.
I use small and split windows as well as
8 character tab stops. (4 characters just blend into the background..)
> I think a better solution is this request
Adam Ruppe:
> I'm still trying to find something I like for this.
Me too.
> Error messages give a line number... but if there's still several
> points of similar failure on that one line, it doesn't help as much
> as it could.
I understand. But splitting lines too much make the code a bit too
On 02/08/2011 04:11 PM, Adam Ruppe wrote:
I know, but I was suggesting something different, to turn the JSON
> creation into some kind of Phobos library that you may call at
> compile-time from normal D code. Then a compile-time JSON reader in
> Phobos will allow to perform certain kinds of st
bearophile:
> This kind of indentations is interesting:
I'm still trying to find something I like for this. Currently,
I see the contracts as part of the public interface, just like
the name, so I'm indenting them like I would if the argument list
ran too long.
void doSomethingBig(
int arg1
Hamad:
> == Quote from Adam Ruppe (destructiona...@gmail.com)'s article
> > My implementation
> > http://arsdnet.net/tictactoe.d
> after your permtion i post your code in
> http://rosettacode.org/wiki/Tic-tac-toe
On Rosettacode they don't want too much long lines, so I suggest you to reduce
ind
== Quote from Adam Ruppe (destructiona...@gmail.com)'s article
> My implementation
> http://arsdnet.net/tictactoe.d
after your permtion i post your code in http://rosettacode.org/wiki/Tic-tac-toe
Adam Ruppe:
> My implementation
> http://arsdnet.net/tictactoe.d
Thank you for your answers and code. Your code is better.
This kind of indentations is interesting:
string positionString(int pos)
in {
assert(...);
}
out(ret) {
assert(...);
}
body {
// ...
}
My implementation
http://arsdnet.net/tictactoe.d
source: 138 lines, 2420 bytes
You can see the byte count is comparable to the python 2, but I have
more lines. This reflects my preferences of one line = one instruction.
I usually prefer "Introduction to Programming" style code than
"functional c
"Jonathan M Davis" wrote in message
news:mailman.1384.1297127779.4748.digitalmar...@puremagic.com...
>
> I don't even try and program in D like I would in C++.
Neither would I. For instance, if I were about to do some coding in C++, I
would begin by bashing my head into a brick wall. Sure, that
On Monday, February 07, 2011 17:11:50 bearophile wrote:
> Nick Sabalausky:
> > (Although, I didn't read the OP very closely, so maybe I'm off-base.)
>
> They are right, I have done a "strategic" error. In the original post I
> have mixed two kinds of very unrelated things: very small suggestions t
On Monday, February 07, 2011 16:55:02 Andrew Wiley wrote:
> On Mon, Feb 7, 2011 at 6:36 PM, bearophile wrote:
> > Jonathan M Davis:
> > > Regardless of what language you're
> > > programming in, it's generally best to program in the typical paradigms
> >
> > of that
> >
> > > language. Trying to
Nick Sabalausky:
> (Although, I didn't read the OP very closely, so maybe I'm off-base.)
They are right, I have done a "strategic" error. In the original post I have
mixed two kinds of very unrelated things: very small suggestions to improve (in
my opinion) Phobos, plus some critiques to the D2
"Nick Sabalausky" wrote in message
news:iiq4pa$28aa$1...@digitalmars.com...
> "Jonathan M Davis" wrote in message
> news:mailman.1382.1297122691.4748.digitalmar...@puremagic.com...
>> On Monday, February 07, 2011 15:34:26 bearophile wrote:
>>> Adam Ruppe:
>>> > My gut tells me you'd get much be
"Jonathan M Davis" wrote in message
news:mailman.1382.1297122691.4748.digitalmar...@puremagic.com...
> On Monday, February 07, 2011 15:34:26 bearophile wrote:
>> Adam Ruppe:
>> > My gut tells me you'd get much better results if you tried to
>> > write D in D instead of Python in D.
>>
>> That's r
On Mon, Feb 7, 2011 at 6:36 PM, bearophile wrote:
> Jonathan M Davis:
>
> > Regardless of what language you're
> > programming in, it's generally best to program in the typical paradigms
> of that
> > language. Trying to contort it to act like another language is _not_
> going to
> > result in op
Jonathan M Davis:
> Regardless of what language you're
> programming in, it's generally best to program in the typical paradigms of
> that
> language. Trying to contort it to act like another language is _not_ going to
> result in optimal code.
D supports functional style too now. In Bugzilla
On Monday, February 07, 2011 15:34:26 bearophile wrote:
> Adam Ruppe:
> > My gut tells me you'd get much better results if you tried to
> > write D in D instead of Python in D.
>
> That's really beside the point. The point of the post is that there are
> some spots where I'd like to see Phobos imp
Adam Ruppe:
> My gut tells me you'd get much better results if you tried to
> write D in D instead of Python in D.
That's really beside the point. The point of the post is that there are some
spots where I'd like to see Phobos improved. (And I am willing to write part of
the Phobos code I am as
My gut tells me you'd get much better results if you tried to
write D in D instead of Python in D.
I might take a stab at this myself. I can see lots of improvements
to the original code.
I've found another taks in the rosettacode.org site:
http://rosettacode.org/wiki/Tic-tac-toe
The program itself is not so interesting, and probably there are better ways to
implement a Tic-tac-toe player program. But it's a good enough example to test
Phobos2, to see how much handy it is when yo
24 matches
Mail list logo