On 9/02/11 3:08 AM, Nick Sabalausky wrote:
AUIU, foreach has both of these forms:
foreach(x; 0..5)
foreach(x; someRange)
Also, we have:
auto someRange = iota(0, 5);
Pardon if this has already been suggested.
I have suggested it in the past, and I believe people had suggested
On Wed, 2011-02-09 at 00:16 -0600, Christopher Nicholson-Sauls wrote:
[ . . . ]
> xml.book(...) as sugar for xml.tag("book",...) make it xml.bookTag(...)
using xml.bookTag would ruin it for me. I'd use something that allowed
just book, xml.book is already not enough of a DSL.
--
Russel.
=
On 01/26/11 16:45, Andrei Alexandrescu wrote:
> Seems to be unduly difficult in Python:
>
> http://www.google.com/buzz/michael.bruntonspall/AcMtiMEUgZ2/Packaging-and-deploying-python-web-apps
>
>
> We need to have a good solution for D.
>
>
> Andrei
This seems related to a project I've been p
On 02/06/11 18:18, Tomek Sowiński wrote:
> Rainer Schuetze napisał:
>
>> This looks nice and compact Using opDispatch to specify the tag (I guess
>> that is what you are using to create a tag "book" by calling xml.book())
>> feels like misusing opDispatch, though. Does it add readability in
>>
On 02/08/11 19:02, Andrei Alexandrescu wrote:
> https://gist.github.com/817504
>
> I added a D version.
>
> Andrei
I would argue that (a & 1 == 0) is a cheaper simple test for evenness...
Good show. Not really sure what the point of the list was... but
sometimes these things are just (for) f
AUIU, foreach has both of these forms:
foreach(x; 0..5)
foreach(x; someRange)
Also, we have:
auto someRange = iota(0, 5);
Little idea: How about this genralized lowering?
0..5
// iota says "Gimme some sugar, baby."
// and thus it is lowered to ->
iota(0, 5)
Of cour
On Tue, Feb 8, 2011 at 7:16 PM, Andrej Mitrovic
wrote:
> I don't know why I thought this would be easy. ReadDirectoryChangesW
> is a b**ch to use. Someone even wrote a wrapper for it:
> http://www.codeproject.com/KB/files/directorychangewatcher.aspx
>
> It clocks in at over 1500 lines. For a singl
On 2/8/11 8:02 PM, Andrei Alexandrescu wrote:
https://gist.github.com/817504
I added a D version.
Andrei
Added a comment too (andralex).
Andrei
On 02/09/2011 01:16 AM, Tomek Sowiński wrote:
Steven Schveighoffer napisał:
The design I'm thinking is that the node iterator will own a buffer. One
consequence is that the fields of the current node will point to the
buffer akin to foreach(line; File.byLine), so in order to lift the input
the
On 02/09/2011 01:38 AM, Andrei Alexandrescu wrote:
On 2/8/11 3:50 PM, Steven Schveighoffer wrote:
On Tue, 08 Feb 2011 15:36:14 -0500, Nick Sabalausky wrote:
"Steven Schveighoffer" wrote in message
news:op.vqk74auaeav7ka@steve-laptop...
On Tue, 08 Feb 2011 06:52:30 -0500, Jonathan M Davis
w
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/08/2011 06:29 PM, David Nadlinger wrote:
On 2/8/11 4:29 PM, Andrei Alexandrescu wrote:
Reply here to vote ONLY for the function collectExceptionMsg in Jonathan
M Davis's std.unittests. Vote closes on Tue Feb 15.
As I stated in the assertNotThrown thread, I don't see any reason why this
s
I don't know why I thought this would be easy. ReadDirectoryChangesW
is a b**ch to use. Someone even wrote a wrapper for it:
http://www.codeproject.com/KB/files/directorychangewatcher.aspx
It clocks in at over 1500 lines. For a single API function. Yikes!
Compare this to .Net's FileSystemWatcher.
Andrei:
> https://gist.github.com/817504
>
> I added a D version.
Good :-)
They have missed the lazy Python2.x version:
(x for x in xrange(1, 5) if not x % 2)
Bye,
bearophile
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
https://gist.github.com/817504
I added a D version.
Andrei
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,
On 02/08/2011 07:44 PM, Ary Manzana wrote:
On 2/6/11 8:32 PM, spir wrote:
When does one need to write by hand, in source, structured data needing
to be serialised into XML (or any other format)? In my (admittedly very
limited), such data always are outputs of some processing (if only
reading fr
On 2/8/11 3:50 PM, Steven Schveighoffer wrote:
On Tue, 08 Feb 2011 15:36:14 -0500, Nick Sabalausky wrote:
"Steven Schveighoffer" wrote in message
news:op.vqk74auaeav7ka@steve-laptop...
On Tue, 08 Feb 2011 06:52:30 -0500, Jonathan M Davis
wrote:
*Sigh* I was hoping for a clearer vote than
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
On 2/8/11 12:20 PM, Jonathan M Davis wrote:
On Tuesday, February 08, 2011 08:36:27 Andrei Alexandrescu wrote:
On 2/8/11 10:54 AM, Jonathan M Davis wrote:
Enhancement request for assert:
http://d.puremagic.com/issues/show_bug.cgi?id=5547
Thanks!
Okay. I'll look at doing another proposal whic
Steven Schveighoffer napisał:
> > The design I'm thinking is that the node iterator will own a buffer. One
> > consequence is that the fields of the current node will point to the
> > buffer akin to foreach(line; File.byLine), so in order to lift the input
> > the user will have to dup (or p
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
Don wrote:
Andrej Mitrovic wrote:
Btw, how up-to-date are the import libs in windows/lib that ships with
DMD2? Can they be used with e.g. Win7?
They are horribly outdated.
True, but MS never changes the api's, so they work and continue to work fine.
Andrew Wiley wrote:
I'm trying to use the Windows file change notification API from D, and
I'm having trouble translating Microsoft's macro-laden signatures into
D. I thought I had it figured out, but optlink says otherwise:
The original function is this:
HANDLE WINAPI FindFirstChangeNotificatio
Andrei Alexandrescu napisał:
> Reply here to vote ONLY for the function collectExceptionMsg in Jonathan
> M Davis's std.unittests. Vote closes on Tue Feb 15.
I'm in two minds. Since Jonathan has improved collectException the proposed
function is just a short-hand for:
auto e = collectException
Am 08.02.2011 22:37, schrieb Stewart Gordon:
On 08/02/2011 12:25, Trass3r wrote:
I wonder if these bindings would be suitable for inclusion in the
core.sys.windows package?
They definitely need to be merged.
Merged? The whole point of the bindings project is that it will one day
be complete.
fwiw, I've had more luck using coffimplib on the libs from the Windows platform
SDK than i have using implib on the dlls.
On 08/02/2011 12:25, Trass3r wrote:
I wonder if these bindings would be suitable for inclusion in the
core.sys.windows package?
They definitely need to be merged.
Merged? The whole point of the bindings project is that it will one day be complete. As
such, it needs to _replace_ the curren
Andrei Alexandrescu Wrote:
> Reply here to vote ONLY for the function assertNotThrown in Jonathan M
> Davis's std.unittests. Vote closes on Feb 15.
>
> Andrei
Yes!
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
How many corrections?
I thought snn.lib was druntime in disguise. It's Digital Mars C/C++
runtime library. I'll just put all the originals back.
Correction: Not Phobos, druntime.
Nevermind, uuid isn't an import library, apparently it holds some
GUID's for COM objects(?).
Replacing those import libs now seems like a bad idea because phobos
can't find a ton of symbols. Eh, it's never easy, is it..
On Tue, 08 Feb 2011 15:36:14 -0500, Nick Sabalausky wrote:
"Steven Schveighoffer" wrote in message
news:op.vqk74auaeav7ka@steve-laptop...
On Tue, 08 Feb 2011 06:52:30 -0500, Jonathan M Davis
wrote:
*Sigh* I was hoping for a clearer vote than this.
Sorry for the lack of voting/attention
Andrei Alexandrescu napisał:
> For the latter, Tomek's idea of passing an output range as
> an optional second parameter seems appropriate. Please file as an
> enhancement to bugzilla. If anyone has time to work on this, please do.
> If not, I'll work on it as my schedule allows.
http://d.pure
"Steven Schveighoffer" wrote in message
news:op.vqk74auaeav7ka@steve-laptop...
> On Tue, 08 Feb 2011 06:52:30 -0500, Jonathan M Davis
> wrote:
>
>> *Sigh* I was hoping for a clearer vote than this.
>
> Sorry for the lack of voting/attention, I've had barely any time to work
> with D lately, an
"Andrei Alexandrescu" wrote in message
news:iirnmf$28ig$5...@digitalmars.com...
> Reply here to vote ONLY for the function assertNotThrown in Jonathan M
> Davis's std.unittests. Vote closes on Feb 15.
>
"YES"
"Andrei Alexandrescu" wrote in message
news:iirnm1$28ig$4...@digitalmars.com...
> Reply here to vote ONLY for the function collectExceptionMsg in Jonathan M
> Davis's std.unittests. Vote closes on Tue Feb 15.
>
> Andrei
"YES"
That's exactly what I did a minute ago:
For %%a in (*.dll) do implib /s %%~na.lib %%a
:)
Gotta hate that cryptic batch syntax though..
I am still missing these two though:
uuid.dll
winspool.dll
>From what I can tell uuid is used with COM, but it isn't installed on
my system for some reason. Wi
"Jonathan M Davis" wrote in message
news:mailman.1401.1297185535.4748.digitalmar...@puremagic.com...
> On Tuesday, February 08, 2011 08:36:27 Andrei Alexandrescu wrote:
>> On 2/8/11 10:54 AM, Jonathan M Davis wrote:
>> > Enhancement request for assert:
>> > http://d.puremagic.com/issues/show_bug.
Andrei Alexandrescu napisał:
> > I know about Steven's proposal but it applies only to user types not
> > primitives. Either way std.conv.to would need a buffered output range as
> > integers are written from the right. Any chance for an abstraction
> > analogous to buffered input ranges discus
So, implib /s on my system DLLs, right?
Does anyone have a script to do that? I'm lazy. :p
Something like:
FOR %%i IN (*.dll) DO implib /system %%~ni.lib %%i
On 2/8/11, Don wrote:
> Andrej Mitrovic wrote:
>> Btw, how up-to-date are the import libs in windows/lib that ships with
>> DMD2? Can they be used with e.g. Win7?
>
> They are horribly outdated. But I have a vague recollection that Walter
> has explicit permission from Microsoft to redistribute up
novice2 wrote:
Wow, I didn't know this existed. I wonder if these bindings would be
suitable for inclusion in the core.sys.windows package? Currently,
core.sys.windows.windows only contains a small subset of the
one bad (imho) thing - functions parameters names removed :( just types
remains
Andrej Mitrovic wrote:
Btw, how up-to-date are the import libs in windows/lib that ships with
DMD2? Can they be used with e.g. Win7?
They are horribly outdated. But I have a vague recollection that Walter
has explicit permission from Microsoft to redistribute updated versions.
On 2011-02-08 12:26:23 -0500, Andrej Mitrovic
said:
So in the most basic form assertThrown is used to check that our
functions throw on bad (user) input,
and assertNotThrown is used to check that our functions work with valid input?
Most functions are said to work whey they have the desired
On 2/6/11 8:32 PM, spir wrote:
When does one need to write by hand, in source, structured data needing
to be serialised into XML (or any other format)? In my (admittedly very
limited), such data always are outputs of some processing (if only
reading from other file).
denis
If you have a websi
Am 08.02.2011 16:30, schrieb Andrei Alexandrescu:
> Reply here to vote ONLY for the function assertNotThrown in Jonathan M Davis's
> std.unittests. Vote closes on Feb 15.
>
> Andrei
Voting YES, because (quoting my post in another Thread):
Maybe it can be nested like
assertThrown!Exception( a
Voting Yes.
Btw, how up-to-date are the import libs in windows/lib that ships with
DMD2? Can they be used with e.g. Win7?
On 2/8/11 4:29 PM, Andrei Alexandrescu wrote:
Reply here to vote ONLY for the function collectExceptionMsg in Jonathan
M Davis's std.unittests. Vote closes on Tue Feb 15.
As I stated in the assertNotThrown thread, I don't see any reason why
this shouldn't be included if it's helpful for other
On Tuesday, February 08, 2011 09:26:23 Andrej Mitrovic wrote:
> So in the most basic form assertThrown is used to check that our
> functions throw on bad (user) input,
> and assertNotThrown is used to check that our functions work with valid
> input?
>
> Looks good to me.
Yes.
- Jonathan M Davis
So in the most basic form assertThrown is used to check that our
functions throw on bad (user) input,
and assertNotThrown is used to check that our functions work with valid input?
Looks good to me.
On 2/8/11 4:30 PM, Andrei Alexandrescu wrote:
Reply here to vote ONLY for the function assertNotThrown in Jonathan M
Davis's std.unittests. Vote closes on Feb 15.
Sorry, I didn't phrase the part of my previous message concerning
assertNotThrown and collectExceptionMsg quite clearly. What I mea
On Tuesday, February 08, 2011 08:36:27 Andrei Alexandrescu wrote:
> On 2/8/11 10:54 AM, Jonathan M Davis wrote:
> > Enhancement request for assert:
> > http://d.puremagic.com/issues/show_bug.cgi?id=5547
>
> Thanks!
>
> > Okay. I'll look at doing another proposal which has the functionality of
> >
On Tue, 08 Feb 2011 11:49:47 -0500, spir wrote:
On 02/08/2011 05:17 PM, Steven Schveighoffer wrote:
What is the difference between:
bool opEquals(T)(T y) if (is(T == BigRational)) {...}
and
bool opEquals(T)(T y)
{
static if(is(T == BigRational)) {...}
else static assert(0, "invalid type")
Am 08.02.2011 18:00, schrieb spir:
> On 02/08/2011 04:54 PM, Jonathan M Davis wrote:
>> I would point out, however, that it would be rather silly to include
>> assertThrown and not assertNotThrown. Good unit tests should test_both_
>> that a
>> function succeeds as it's supposed to_and_ that it
On 02/08/2011 04:54 PM, Jonathan M Davis wrote:
I would point out, however, that it would be rather silly to include
assertThrown and not assertNotThrown. Good unit tests should test_both_ that a
function succeeds as it's supposed to_and_ that it fails as it's supposed to.
So, I would hope that
On 2/8/11, Andrew Wiley wrote:
> I'm trying to use the Windows file change notification API from D, and
> I'm having trouble translating Microsoft's macro-laden signatures into
> D. I thought I had it figured out, but optlink says otherwise:
> The original function is this:
That's odd, I was just
On 02/08/2011 05:17 PM, Steven Schveighoffer wrote:
On Tue, 08 Feb 2011 10:52:35 -0500, spir wrote:
On 02/08/2011 12:16 AM, bearophile wrote:
Charles McAnany:
Hi, all. So I'm trying to make a BigRational struct, to get more comfortable
with D.
I just thought at this alternative between
Am 08.02.2011 17:40, schrieb Kagamin:
Trass3r Wrote:
> HANDLE WINAPI FindFirstChangeNotification(
>__in LPCTSTR lpPathName,
>__in BOOL bWatchSubtree,
>__in DWORD dwNotifyFilter
> );
FindFirstChangeNotification is - like any other Windows function that receives
a string
Am 08.02.2011 17:40, schrieb Kagamin:
Trass3r Wrote:
> HANDLE WINAPI FindFirstChangeNotification(
>__in LPCTSTR lpPathName,
>__in BOOL bWatchSubtree,
>__in DWORD dwNotifyFilter
> );
FindFirstChangeNotification is - like any other Windows function that receives
a string
On Tue, Feb 8, 2011 at 10:40 AM, Kagamin wrote:
> Trass3r Wrote:
>
>> > HANDLE WINAPI FindFirstChangeNotification(
>> > __in LPCTSTR lpPathName,
>> > __in BOOL bWatchSubtree,
>> > __in DWORD dwNotifyFilter
>> > );
>>
>> FindFirstChangeNotification is - like any other Windows function that
On 2/8/11 10:54 AM, Jonathan M Davis wrote:
Enhancement request for assert:
http://d.puremagic.com/issues/show_bug.cgi?id=5547
Thanks!
Okay. I'll look at doing another proposal which has the functionality of
assertPred which doesn't make sense to add to assert, though I'll probably wait
until
Trass3r Wrote:
> > HANDLE WINAPI FindFirstChangeNotification(
> > __in LPCTSTR lpPathName,
> > __in BOOL bWatchSubtree,
> > __in DWORD dwNotifyFilter
> > );
>
> FindFirstChangeNotification is - like any other Windows function that
> receives a string - just an alias that points to a ver
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
On Tue, 08 Feb 2011 11:09:44 -0500, Steven Schveighoffer
wrote:
On Tue, 08 Feb 2011 10:55:23 -0500, spir wrote:
On 02/07/2011 11:38 PM, Tomek Sowiński wrote:
Jonathan M Davis napisał:
On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote:
Looks like std.conv.to always allocates behin
On Tue, 08 Feb 2011 10:52:35 -0500, spir wrote:
On 02/08/2011 12:16 AM, bearophile wrote:
Charles McAnany:
Hi, all. So I'm trying to make a BigRational struct, to get more
comfortable
with D.
I suggest to ask similar questions in the D.learn newsgroup.
bool opEquals(Tdummy = void)(Big
On Tue, 08 Feb 2011 10:55:23 -0500, spir wrote:
On 02/07/2011 11:38 PM, Tomek Sowiński wrote:
Jonathan M Davis napisał:
On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote:
Looks like std.conv.to always allocates behind the scenes. It's a
shame as
the returned string is immediately p
On Tuesday 08 February 2011 07:55:23 spir wrote:
> On 02/07/2011 11:38 PM, Tomek Sowiński wrote:
> > Jonathan M Davis napisał:
> >> On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote:
> >>> Looks like std.conv.to always allocates behind the scenes. It's a shame
> >>> as the returned string is
On 02/08/2011 12:16 AM, bearophile wrote:
Charles McAnany:
Hi, all. So I'm trying to make a BigRational struct, to get more comfortable
with D.
I suggest to ask similar questions in the D.learn newsgroup.
bool opEquals(Tdummy = void)(BigRational y){
auto temp = this-y;
if (
On 02/07/2011 11:38 PM, Tomek Sowiński wrote:
Jonathan M Davis napisał:
On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote:
Looks like std.conv.to always allocates behind the scenes. It's a shame as
the returned string is immediately processed and discarded in my XML
writer. Are there pl
On Tuesday 08 February 2011 07:27:55 Andrei Alexandrescu wrote:
> Vote has closed last night at 23:59:59:99, but I accepted Lars' late vote.
>
> Thanks Jonathan for responding to comments and suggestions, and for a
> very dedicated attitude throughout.
>
> YES votes mean wholesale acceptance of t
> > Wow, I didn't know this existed. I wonder if these bindings would be
> > suitable for inclusion in the core.sys.windows package? Currently,
> > core.sys.windows.windows only contains a small subset of the
one bad (imho) thing - functions parameters names removed :( just types
remains. it i
Tomek Sowiński wrote:
I am now intensely accumulating information on how to go about creating a
high-performance parser as it quickly became clear that my old one won't
deliver. And if anything is clear is that memory is the key.
One way is the slicing approach mentioned on this NG, notably us
Reply here to vote ONLY for the function assertNotThrown in Jonathan M
Davis's std.unittests. Vote closes on Feb 15.
Andrei
Reply here to vote ONLY for the function collectExceptionMsg in Jonathan
M Davis's std.unittests.
Andrei
Vote has closed last night at 23:59:59:99, but I accepted Lars' late vote.
Thanks Jonathan for responding to comments and suggestions, and for a
very dedicated attitude throughout.
YES votes mean wholesale acceptance of the library. NO means either
partial acceptance or no acceptance at all.
Reply here to vote ONLY for the function assertNotThrown in Jonathan M
Davis's std.unittests.
Andrei
Reply here to vote ONLY for the function collectExceptionMsg in Jonathan
M Davis's std.unittests. Vote closes on Tue Feb 15.
Andrei
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
On Sun, Jan 30, 2011 at 09:23:50PM +0100, Thomas Klausner wrote:
> Since it looked like I would need D for a project, I started porting
> it to NetBSD. The project has been cancelled in the meantime, but I
> don't want my patches to be lost, so I offer them here for inclusion.
Anyone interested?
On Tue, 08 Feb 2011 06:52:30 -0500, Jonathan M Davis
wrote:
*Sigh* I was hoping for a clearer vote than this.
Sorry for the lack of voting/attention, I've had barely any time to work
with D lately, and I haven't even looked at your lib.
-Steve
P.S. I'm f***ing sick of snow...
On 2011-02-08 05:54, Robert Jacques wrote:
On Sat, 05 Feb 2011 13:14:42 -0500, Jacob Carlborg wrote:
On 2011-02-04 05:07, Jonathan M Davis wrote:
[snip]
Most of the good examples of runtime reflection that I'm aware of
require user-
defined attributes. But there are libraries in Java (and pre
On Tue, 08 Feb 2011 03:52:30 -0800, Jonathan M Davis wrote:
> *Sigh* I was hoping for a clearer vote than this.
>
> assertThrown, assertNotThrown, and collectExceptionMsg are clearly in,
> but the vote on assertPred is not so clear.
>
> No
> ---
> Brad Roberts (I appeared to be against but didn'
> HANDLE WINAPI FindFirstChangeNotification(
> __in LPCTSTR lpPathName,
> __in BOOL bWatchSubtree,
> __in DWORD dwNotifyFilter
> );
FindFirstChangeNotification is - like any other Windows function that receives
a string - just an alias that points to a version with suffix W or A dependin
> I wonder if these bindings would be suitable for inclusion in the
> core.sys.windows package?
They definitely need to be merged.
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
*Sigh* I was hoping for a clearer vote than this.
assertThrown, assertNotThrown, and collectExceptionMsg are clearly in, but the
vote on assertPred is not so clear.
No
---
Brad Roberts (I appeared to be against but didn't vote outright)
David Nadlinger
Don
Jim? (I _think_ that he was voting no,
spir:
> Is there map & filter for AAs? Is it useful?
Of course it's useful to map and filter on associative arrays. But I think a
much better solution is to turn byValue() and byKey() into ranges, and add a
byPair() range to AAs:
http://d.puremagic.com/issues/show_bug.cgi?id=5466
Bye,
bearophi
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 {
// ...
}
Hello,
Is there map & filter for AAs? Is it useful?
Below example,
Denis
struct Pair (K,V) { K k; V v; }
V2[K2] map (K1,V1, K2,V2) (V1[K1] aa1, Pair!(K2,V2) delegate (K1,V1) f) {
V2[K2] aa2;
Pair!(K2,V2) pair;
foreach (k,v ; aa1) {
pair = f(k,v);
aa2[pair.k] = pair
On Tue, 08 Feb 2011 09:52:24 +0200, Lars T. Kyllingstad
wrote:
Wow, I didn't know this existed. I wonder if these bindings would be
suitable for inclusion in the core.sys.windows package? Currently,
core.sys.windows.windows only contains a small subset of the Windows API.
That would be gr
95 matches
Mail list logo