Re: Get n-th

2011-02-22 Thread Jonathan M Davis
On Tuesday 22 February 2011 18:07:46 bearophile wrote: > Do you know a much nicer way to take just the n-th item of a lazy range? > > > import std.stdio, std.array, std.range; > void main() { > auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1); > writeln(array(take(fib, 10)).back); > } > >

Get n-th

2011-02-22 Thread bearophile
Do you know a much nicer way to take just the n-th item of a lazy range? import std.stdio, std.array, std.range; void main() { auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1); writeln(array(take(fib, 10)).back); } In Python I use next(isslice(x, n, n+1)): >>> from itertools import isli

Re: rdmd problems (OS X Leopard, DMD 2.052)

2011-02-22 Thread Paolo Invernizzi
Hi Magnus, This is sligthly OT, but... How I loved AnyGui! It's nice to see you here, in the D bandwagon... Cheers, Paolo Invernizzi Magnus Lie Hetland Wrote: > Hi! > > When I installed DMD 2.051 on my OS X boxen, the rdmd executable didn't > work. I saw others have similar problems online,

Re: Read non-UTF8 file

2011-02-22 Thread Nrgyzer
== Auszug aus Stewart Gordon (smjg_1...@yahoo.com)'s Artikel > What compiler version/platform are you using? I had to fix some errors > before it would > compile on mine (1.066/2.051 Windows). > On 19/02/2011 13:42, Nrgyzer wrote: > > > Now... and with writefln("%s", cast(ubyte[]) convertToUTF8(

Re: Are function pointers compile time constants?

2011-02-22 Thread Kagamin
Simon Wrote: > You could make function pointers compile time constants if: > > You disallow ASR > You disallow them when compiling to a dll > You disallow in-lining of any function of which you take the address > You disallow the linker from rearranging functions > You disallow the linker from me

Re: using a binary tree container

2011-02-22 Thread Lutger Blijdestijn
Sorry I almost forgot: http://d.puremagic.com/issues/show_bug.cgi?id=5640 The issue with remove is talked about in digitalmars.D and perhaps not really specific to RedBlackTree.