Re: [racket-users] Re: is this a bug?

2015-08-01 Thread Ian Tegebo
On Wednesday, July 29, 2015 at 8:17:06 AM UTC-7, Michael Titke wrote: > (define (apply-or well-formed-list) > >   (foldl {lambda (a b) (or a b)} > > #f > > well-formed-list)) > > (define (apply-and well-formed-list) > >   (foldl {lambda (a b) (and a b)

Re: [racket] taking from a generator, and a possible bug

2012-08-19 Thread Ian Tegebo
On Sat, Aug 18, 2012 at 10:51 PM, Asumu Takikawa wrote: > On 2012-08-18 21:59:28 -0700, Ian Tegebo wrote: >> (take k (in-generator (infinite-generator (yield (random n) >> >> where k and n are positive integers, k> >> Unfortunately, 'in-generator'

Re: [racket] taking from a generator, and a possible bug

2012-08-19 Thread Ian Tegebo
think this addresses the larger issue with large/infinite streams/generators, I'll certainly use this trick for small lists. > On Aug 18, 2012, at 10:59 PM, Ian Tegebo wrote: > >> (define (call-n-times f n) >>(define (helper f n lst) >> (if (< n 1) >

[racket] taking from a generator, and a possible bug

2012-08-18 Thread Ian Tegebo
a b); other arguments were: 1 My current approach aside, is there a better way? Here's my workaround, (define (call-n-times f n) (define (helper f n lst) (if (< n 1) lst (helper f (- n 1) (cons (f) lst (helper f n '())) (define (take-randoms k n)

Re: [racket] Bootstrapping an FFI

2012-08-11 Thread Ian Tegebo
gt; https://github.com/pb82/sdl4racket > > On 11.08.2012 04:43, Ian Tegebo wrote: >> >> I'm playing around with an FFI for SDL. Rather than slog through all >> the headers by hand, I went looking for some code that may do a bit of >> the parsing and translation.

[racket] Bootstrapping an FFI

2012-08-10 Thread Ian Tegebo
"__extension__=" -D "__attribute__(ARGS)=" -E /usr/include/SDL/SDL.h | sed '/^\#/d' | indent -st -i2 |grep -vE '^[[:space:]]*$' > sdl.h Has anyone else gone down this road before? Also, Besides Eli's paper, any general advice for Racket FFIs? Than

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Ian Tegebo
ist str) > > This looks rather clumsy to me. [...] Any suggestions? So far, no one has suggested a regexp. Why not, (define (all-lower-case? s) (not (regexp-match? #rx"[A-Z]" s))) -- Ian Tegebo Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Is racket-lang.org written in Racket?

2012-07-01 Thread Ian Tegebo
On Sun, Jul 1, 2012 at 2:05 PM, Robby Findler wrote: > On Sun, Jul 1, 2012 at 3:50 PM, Jay McCarthy wrote: >> On Sun, Jul 1, 2012 at 1:27 AM, Ian Tegebo wrote: >>> Is racket-lang.org written in Racket? >> >> It is statically generated by this code: >> >>

[racket] Is racket-lang.org written in Racket?

2012-07-01 Thread Ian Tegebo
Is racket-lang.org written in Racket? Also, where is the source for planet.racket-lang.org? -- Ian Tegebo Racket Users list: http://lists.racket-lang.org/users

[racket] Are there any papers that explain Code/Structure Inspectors?

2012-06-24 Thread Ian Tegebo
. That aside, are there any papers that introduce "inspectors"? -- Ian Tegebo Racket Users list: http://lists.racket-lang.org/users