Re: [racket-users] Re: Fast way to map over a list many times, changing ONE element each time?

2015-06-19 Thread Luke Miles
My 1000 numbers were so small that they weren't reliable. Change the `num-runs-per-f` and experiment yourself, if you'd like. The code is attached. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving

[racket-users] Re: Fast way to map over a list many times, changing ONE element each time?

2015-06-19 Thread Luke Miles
I timed all these with `sqr` on a list of 1 `(random)`. Luke's (my) first one: cpu time: 4706 real time: 4699 gc time: 3673 Luke's second one: cpu time: 5401 real time: 5393 gc time: 4136 Jon's first one: cpu time: 9734 real time: 9728 gc time: 8007 Jon's second one (tested on a vector of

[racket-users] Fast way to map over a list many times, changing ONE element each time?

2015-06-19 Thread Luke Miles
Say I have a list ls and I want to produce a list of lists where the i'th list has the i'th element of ls tripled, but all other elements are the same. e.g. '(3 5 7) = '((9 5 7) (3 15 7) (3 5 21)) What is a fast way to do this? I could do a loop with appending. (define (map-once f ls) (let M

[racket-users] Re: OK to post Redex and HtDP questions here?

2015-06-13 Thread Luke Miles
I don't post here a whole lot, but From the description of this mailing list: This is the right place for discussion of nearly all Racket issues. So I'd say yeah. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and

[racket-users] Re: Get list of all predefined identifiers for use in vim syntax highlighting

2015-06-02 Thread Luke Miles
To provide some closure: -The generator provided by Jens completely worked. I set up vim to have one color indentation for keywords, and another color indentation for builtins. -The ambiguity brought up by Greg has shown not to be a problem. I only touched racket/base, as I nearly

[racket-users] strange bug with racket/gui

2015-06-02 Thread Luke Miles
2 questions. First, when the the attached code is run, `send` throws an error because `dc` still has the value of void. Strangely, if I execute the below line in the REPL after the code has run, the rectangle is successfully displayed. (send dc draw-rectangle 30 20 10 40) Why is `dc` still

[racket-users] Get list of all predefined identifiers for use in vim syntax highlighting

2015-06-01 Thread Luke Miles
For those who like to write their racket code in vim, the plugin https://github.com/wlangstroth/vim-racket is pretty essential. Unfortunately, it is outdated and many of the new predefined identifiers (e.g. set-add!) are not highlighted. I added a few of these in my personal settings, but it

Re: [racket-users] Get list of all predefined identifiers for use in vim syntax highlighting

2015-06-01 Thread Luke Miles
. It was used to generate the keywords for the Github highlighter. https://github.com/soegaard/racket-highlight-for-github/blob/master/generate-keywords.rkt /Jens Axel 2015-06-01 17:07 GMT+02:00 Luke Miles rashrep...@gmail.com: For those who like to write their racket code