There's not currently anything like `#reader` that would hide a closing
parenthesis from the reader.
I think you could make a new reader that recurs to `read` with an input
port that stops consuming input from the original just before a closing
parenthesis followed by an EOF --- maybe by peeking a
Haha, yes I too checked Racket `shuffle` after I read that. But
`shuffle` is mathematically sound. (Was I really surprised?) It doesn't
use a random comparator. Rather, it assigns random *keys* to the
elements and then uses a standard `<` comparator, which preserves
transitivity (net of the nan
On 2014-09-15 21:24:53 -0700, Eric Dobson wrote:
> This is different than linked algorithm. This one assigns a random
> number from [0,1) to each element where the linked algorithm assigns a
> random pairwise ordering to each comparison.
>
> I don't think there is anything wrong from a correctness
On Mon, Sep 15, 2014 at 8:50 PM, Asumu Takikawa wrote:
> On 2014-09-15 18:57:51 -0700, Matthew Butterick wrote:
>> Mike Bostock's visual demonstration of why naive sorting functions are false
>> friends. As he and Henglein point out, transitivity of the comparator is
>> essential.
>>
>> http://bos
On 2014-09-15 18:57:51 -0700, Matthew Butterick wrote:
> Mike Bostock's visual demonstration of why naive sorting functions are false
> friends. As he and Henglein point out, transitivity of the comparator is
> essential.
>
> http://bost.ocks.org/mike/shuffle/compare.html
Thanks, that's really int
> Using `#:atomic? #t` disables Racket thread switches, but it doesn't
> disable GC.
> It's not so much about modification as referencing the memory ---
> either reading or writing --- across a potential GC.
Thank you! It's clear now.
> Now that I look closely, I think you need the `bytes-copy!`
Mike Bostock's visual demonstration of why naive sorting functions are
false friends. As he and Henglein point out, transitivity of the
comparator is essential.
http://bost.ocks.org/mike/shuffle/compare.html
On 09/15/14 2:16 PM, Robby Findler wrote:
Fritz Henglein has studied the problem "what
Fritz Henglein has studied the problem "what is a sorting function?" that
touches on this kind of thing.
http://www.sciencedirect.com/science/article/pii/S1567832608001094
Robby
On Monday, September 15, 2014, David Van Horn wrote:
> On 9/15/14, 4:53 PM, David Van Horn wrote:
> > I don't think
On 9/15/14, 4:53 PM, David Van Horn wrote:
> I don't think you made enough examples.
Nope - my bad. Cute. Awful, but cute (and there could be correct
implementations of sort that would break your rev).
David
Racket Users list:
http://lists.racket-lang.org/users
I don't think you made enough examples.
On 9/15/14, 4:48 PM, Daniel Bastos wrote:
> Dear Racketeers, I was studying the exercise 20.2.4 of HtDP when I
> came up with this way of reversing lists. (Every element is a least
> element. Or greatest.)
>
> (define (f x y) true)
>
> (define (rev ls) (so
Dear Racketeers, I was studying the exercise 20.2.4 of HtDP when I came up
with this way of reversing lists. (Every element is a least element. Or
greatest.)
(define (f x y)
true)
(define (rev ls)
(sort ls f))
Welcome to DrRacket, version 6.0.1 [3m].
Language: Intermediate Student; memory li
I'm aware that `#lang name ...` is equivalent to `(module id name ...)`.
But `#lang` automatically picks up a reader; `module` does not.
Is there a way to attach a reader to the `module` form (the idea being
that then, within the `module` expression, you could write using the
native syntax of
Welcome to Racket v6.1.0.8.
> (define (repeater f count) (for ((i (in-range count))) (f)))
> (repeater (lambda () (displayln "hello world")) 10)
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
On Sep 15, 2014, at 1:50 PM,
Not more efficient, but perhaps more readable:
(define (repeater f count)
(for ([x (in-range count)])
(f)))
On Mon, Sep 15, 2014 at 12:50 PM, George Rudolph
wrote:
> All,
>
> I am sure this question has been answered before, but I can’t find it.
>
> Suppose I want to call some function
All,
I am sure this question has been answered before, but I can't find it.
Suppose I want to call some function, either built-in or user-defined, n number
of times, and measure the total time it takes. Is there a more efficient or
elegant way
of doing this than passing the expression to a tail-
Good.
On Sep 15, 2014, at 9:20 AM, Daniel Bastos wrote:
> On Fri, Sep 12, 2014 at 6:43 PM,
> Matthias Felleisen wrote:
>
>
> On Sep 12, 2014, at 4:40 PM, Daniel Bastos wrote:
>
> > Again, we start with (2) and apply a series of substitutions.
> >
> > (f f)
> > = ( ) ;; since f is
On Mon, Sep 8, 2014 at 9:51 PM,
Matthias Felleisen wrote:
On Sep 2, 2014, at 12:05 PM, Daniel Bastos wrote:
>
> > Exercise 20.1.2. Argue why the following sentences are legal
> > definitions:
> >
> > (define (f x) (x 10))
> >
> > (define (f x) f)
> >
> > (define (f x y) (x 'a y 'b))
> >
> > Solut
On Fri, Sep 12, 2014 at 6:43 PM,
Matthias Felleisen wrote:
> On Sep 12, 2014, at 4:40 PM, Daniel Bastos wrote:
>
> > Again, we start with (2) and apply a series of substitutions.
> >
> > (f f)
> > = ( ) ;; since f is a
> > = ( ) ;; since is a subset of
> >
> > However, ( ) is not by
> I think that changing `_pointer` to `_DWORD` can't be the real answer,
> since `_pointer` is at least as large as `_DWORD`.
Facepalm. Of course, you're right! Somehow, I've thought that _pointer
is twice shorter :)
> But I agree that you should use `malloc`, and you should also supply
> 'atomi
19 matches
Mail list logo