Re: [racket] Quarter-circle in upper right of Definitions window?

2012-09-17 Thread Laurent
Fantastic! Thank you very much, I prefer it over my plugin, because it automatically gives the doc for the correct identifier. Just too bad it doesn't appear when syntax-check cannot validate due to missing parentheses. Maybe that will make me change my coding style to add closing parens automatica

Re: [racket] sandboxing issue while trying to print slideshow slides

2012-09-17 Thread James T. Perconti
Oops, meant to reply to let everyone know the --trust flag worked and I got my PDF. Thanks again. --Jamie - Original Message - From: "Neil Toronto" To: users@racket-lang.org Sent: Monday, September 17, 2012 10:15:11 PM GMT -05:00 US/Canada Eastern Subject: Re: [racket] sandboxing issue

Re: [racket] sandboxing issue while trying to print slideshow slides

2012-09-17 Thread Neil Toronto
That sounds right. It creates a cache of PNGs (with files named using MD5 sums) to keep from having to render them every time the slideshow is run. It needs filesystem access. Neil ⊥ On 09/17/2012 11:46 AM, Robby Findler wrote: slideshow --trust ? Robby On Mon, Sep 17, 2012 at 12:35 PM, Ja

Re: [racket] generator performance

2012-09-17 Thread Doug Williams
The simulation collection uses continuations extensively - in essence it is a continuation engine - and I get very good performance from it, even for very large simulations. On Mon, Sep 17, 2012 at 4:24 PM, Matthias Felleisen wrote: > > On Sep 16, 2012, at 2:36 PM, Patrick Useldinger wrote: > >>

Re: [racket] Tiny question: Indent `for/fold'

2012-09-17 Thread Robby Findler
I consider this a bug in DrRacket, but haven't had time to look into it. Robby On Mon, Sep 17, 2012 at 3:27 PM, Greg Hendershott wrote: > A tiny, not very important question: > > 1. for/fold documentation: > > (for/fold ([sum 0] >[rev-roots null]) > ([i '(1 2 3 4)]) > (va

Re: [racket] Problem with case

2012-09-17 Thread Jon Zeppieri
On Mon, Sep 17, 2012 at 7:15 PM, David Van Horn wrote: > On 9/17/12 7:11 PM, Jon Zeppieri wrote: > >> The fact that the first one works at all should probably be considered a >> bug. The syntax of case here: >> >> http://docs.racket-lang.org/**reference/case.html?q=case#(** >> form._((lib._racket/

Re: [racket] Problem with case

2012-09-17 Thread David Van Horn
On 9/17/12 7:11 PM, Jon Zeppieri wrote: The fact that the first one works at all should probably be considered a bug. The syntax of case here: http://docs.racket-lang.org/reference/case.html?q=case#(form._((lib._racket/private/more-scheme..rkt)._case)) dictates that the constants in a case clau

Re: [racket] Problem with case

2012-09-17 Thread J. Ian Johnson
The reader turns the 'a into (quote a), so you'd actually also get the 'x1-case given 'quote. I don't think this case is a bug so much as a "gotcha." -Ian - Original Message - From: "Jon Zeppieri" To: "Kieron Hardy" Cc: "users" Sent: Monday, September 17, 2012 7:11:03 PM GMT -05:00 US/C

Re: [racket] Problem with case

2012-09-17 Thread Jon Zeppieri
The fact that the first one works at all should probably be considered a bug. The syntax of case here: http://docs.racket-lang.org/reference/case.html?q=case#(form._((lib._racket/private/more-scheme..rkt)._case)) dictates that the constants in a case clause be parenthesized. The more important i

Re: [racket] Problem with case

2012-09-17 Thread David Van Horn
On 9/17/12 6:47 PM, Kieron Hardy wrote: Hi all, Can anyone explain why the first function below selects 'x1-case as expected but the second fails to select 'x2-case? Am I expecting something to happen that shouldn't? Thanks, Kieron. #lang racket (case 'a ['a 'x1-case] ['b 'x1-c

[racket] Problem with case

2012-09-17 Thread Kieron Hardy
Hi all, Can anyone explain why the first function below selects 'x1-case as expected but the second fails to select 'x2-case? Am I expecting something to happen that shouldn't? Thanks, Kieron. #lang racket (case 'a ['a 'x1-case] ['b 'x1-case] [(15 2 3) 'y1-case] [(10 11 12) '

Re: [racket] generator performance

2012-09-17 Thread Matthias Felleisen
On Sep 16, 2012, at 2:36 PM, Patrick Useldinger wrote: > Which makes me wonder if continuations are really usable in Racket (in terms > of performance)? That is a good question, and the answer is 'yes, in the right situation'. I think the use in the generator code might be not the right situa

Re: [racket] Tiny question: Indent `for/fold'

2012-09-17 Thread Grant Rettke
Put the let bindings on one line. On Mon, Sep 17, 2012 at 3:27 PM, Greg Hendershott wrote: > A tiny, not very important question: > > 1. for/fold documentation: > > (for/fold ([sum 0] >[rev-roots null]) > ([i '(1 2 3 4)]) > (values (+ sum i) (cons (sqrt i) rev-roots))) > >

Re: [racket] Unreachable line reached

2012-09-17 Thread Rouben Rostamian
Matthias, that guide is quite good. I particularly liked the advise on using /define/ rather than /let/ when possible. In reading section 4.1 on comments, I could not figure out the intent/significance of the sentence: "Another use of block comments is for code samples to be copied and pasted int

Re: [racket] Unreachable line reached

2012-09-17 Thread Matthias Felleisen
It's still a draft. On Sep 17, 2012, at 4:33 PM, Paulo J. Matos wrote: > On 17/09/12 21:26, Danny Yoo wrote: >> >> Hi Paolo, >> >> >> I prefer internal definitions now in professional code. Internal >> definitions are recommended by the Racket style guidelines: >> >> http://www.ccs.neu.e

Re: [racket] Unreachable line reached

2012-09-17 Thread Paulo J. Matos
On 17/09/12 21:26, Danny Yoo wrote: Hi Paolo, I prefer internal definitions now in professional code. Internal definitions are recommended by the Racket style guidelines: http://www.ccs.neu.edu/home/matthias/Style/style/Choosing_the_Right_Construct.html#(part._.Definitions) thanks, had no

[racket] Tiny question: Indent `for/fold'

2012-09-17 Thread Greg Hendershott
A tiny, not very important question: 1. for/fold documentation: (for/fold ([sum 0] [rev-roots null]) ([i '(1 2 3 4)]) (values (+ sum i) (cons (sqrt i) rev-roots))) 2. emacs default indent: (for/fold ([sum 0] [rev-roots null]) ([i '(1 2 3 4)]) (values (+ s

Re: [racket] Unreachable line reached

2012-09-17 Thread Danny Yoo
>> >> (for ([line (in-lines in)]) >>(match (string-split line ",") >> [(list path modtime-str md5-str) >> (define modtime (string->number (string-trim modtime-str))) >> (define md5 (string->bytes/utf-8 (string-trim md5-str))) > > why not let for the

Re: [racket] scriblogify/module+ quirk?

2012-09-17 Thread Patrick King
On Sun, 16 Sep 2012 13:06:42 -0400, Ryan Culpepper wrote: > >On 09/15/2012 11:05 PM, Patrick King wrote: > > Windows 7, latest 64 bit Racket, latest Scriblogify from Planet. > > > > C:\...\Source\SlowFlight\Blog>raco scriblogify -p SlowFlight > 12-09-15.scrbl > > file-or-directory-modify-seconds:

Re: [racket] Quarter-circle in upper right of Definitions window?

2012-09-17 Thread John Clements
On Sep 17, 2012, at 12:44 PM, Robby Findler wrote: > It will appear when the online check syntax finds some documentation > for the identifier at the insertion point. If you edit the identifier, > it will disappear (but it may reappear if you move onto another > identifier it knows about). > > G

Re: [racket] Delete Second

2012-09-17 Thread David Van Horn
On 9/17/12 3:46 PM, Ashley Fowler wrote: Well i got (list(car'(())) ===> (()) (list(car'(3))) ===> (3) You changed the first example. If you plug in '() for ls you should get to: (list (car '())) What's the next step? Are you saying I need to change (list(car ls)) ? First, you should

Re: [racket] Delete Second

2012-09-17 Thread Greg Graham
Ashley, I think you're making this more difficult than it needs to be. -Greg -Original Message- From: users-boun...@racket-lang.org [mailto:users-boun...@racket-lang.org] On Behalf Of Ashley Fowler Sent: Monday, September 17, 2012 2:46 PM To: David Van Horn Cc: users@racket-lang.org Subj

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
Well i got  (list(car'(())) ===> (()) (list(car'(3))) ===> (3) Are you saying I need to change (list(car ls)) ? From: David Van Horn [dvanh...@ccs.neu.edu] Sent: Monday, September 17, 2012 3:37 PM To: Ashley Fowler Cc: Danny Yoo; users@racket-lang.o

Re: [racket] Problem passing a reference

2012-09-17 Thread Ryan Culpepper
On 09/17/2012 03:35 PM, Kieron Hardy wrote: Is there actually a reason to use 'set!'? There is a period of time between creating the message and actually processing the message. Other events may cause the message to be abandoned. Therefore I think the set! is required, but maybe there's a

Re: [racket] Quarter-circle in upper right of Definitions window?

2012-09-17 Thread Robby Findler
It will appear when the online check syntax finds some documentation for the identifier at the insertion point. If you edit the identifier, it will disappear (but it may reappear if you move onto another identifier it knows about). Generally speaking, it should match the contents of the blue boxes

Re: [racket] Delete Second

2012-09-17 Thread David Van Horn
On 9/17/12 3:30 PM, Ashley Fowler wrote: Disregard the last message with the questions, I get what your saying now. I had to switch the sign. (define delete-second2 (lambda(ls) (if(> (length ls) 1) (append(list(car ls))(cdr(cdr ls))) (list(car ls) Only problem I got n

Re: [racket] Problem passing a reference

2012-09-17 Thread Kieron Hardy
> Is there actually a reason to use 'set!'? There is a period of time between creating the message and actually processing the message. Other events may cause the message to be abandoned. Therefore I think the set! is required, but maybe there's a better solution. Also, it's suspicious that your

Re: [racket] Unreachable line reached

2012-09-17 Thread Paulo J. Matos
On 17/09/12 18:53, Paulo J. Matos wrote: Even before trying your solution (which I am pretty sure it will ok), besides having also forgotten how to write proper english... yours works ok as expected. -- PMatos Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
Disregard the last message with the questions, I get what your saying now. I had to switch the sign. (define delete-second2 (lambda(ls) (if(> (length ls) 1) (append(list(car ls))(cdr(cdr ls))) (list(car ls) Only problem I got now is the first test still doesn't work. _

Re: [racket] Delete Second

2012-09-17 Thread David Van Horn
On 9/17/12 2:54 PM, Ashley Fowler wrote: Okay I understand. I made some changes (define delete-second2 (lambda(ls) (if(< (length ls) 1) (append(list(car ls))(cdr(cdr ls))) (list(car ls) it works for when I do the following tests: (delete-second2 '(3 7)) ==> (3) (del

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
Okay since it is not meaning what I want it to mean, what is is actually meaning right now? From: danny@gmail.com [danny@gmail.com] on behalf of Danny Yoo [d...@hashcollision.org] Sent: Monday, September 17, 2012 3:18 PM To: Ashley Fowler Cc: users

[racket] Quarter-circle in upper right of Definitions window?

2012-09-17 Thread Prabhakar Ragde
Sorry if this is a dumb question. This small quarter-circle, with an arrow in it, appears from time to time, and then disappears. It contains some links to documentation. I cannot tell what is causing it to appear and what causes it to disappear...? Thanks. --PR Racket Use

Re: [racket] Delete Second

2012-09-17 Thread Danny Yoo
On Mon, Sep 17, 2012 at 12:54 PM, Ashley Fowler wrote: > Okay I understand. I made some changes > > (define delete-second2 > (lambda(ls) > (if(< (length ls) 1) (append(list(car ls))(cdr(cdr ls))) > (list(car ls) > > it works for when I do the following tests: > > (delete-sec

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
Okay I understand. I made some changes (define delete-second2 (lambda(ls) (if(< (length ls) 1) (append(list(car ls))(cdr(cdr ls))) (list(car ls) it works for when I do the following tests: (delete-second2 '(3 7)) ==> (3) (delete-second2 '(a b c d)) ==> (a c d) but it

Re: [racket] Problem passing a reference

2012-09-17 Thread Ryan Culpepper
On 09/17/2012 02:32 PM, Kieron Hardy wrote: Hi all, In the following fragment, I'm trying to create a new event, queue a callback to some handler to process that event, and then clear the event. (define/private (create-message) ... (set! the-event (new some-event%)) ...

Re: [racket] Unreachable line reached

2012-09-17 Thread Paulo J. Matos
On 17/09/12 19:23, Danny Yoo wrote: Hi Paolo, When I look at the program more closely, I think the structure of the iteration might be improved with a "for" loop and the match library. I'm trying to avoid let loops these days just because they remind me too much of GOTO-sytle programming. :)

[racket] Problem passing a reference

2012-09-17 Thread Kieron Hardy
Hi all, In the following fragment, I'm trying to create a new event, queue a callback to some handler to process that event, and then clear the event. (define/private (create-message) ... (set! the-event (new some-event%)) ... ) (define/private (queue-message rece

Re: [racket] Unreachable line reached

2012-09-17 Thread Danny Yoo
> However, after your email I can see that after (loop (read-line in)) > finishes is going to be executed. And this _has_ to be executed > unless there was a return or exception in the function, but since we are in > Racket and I am not playing with call/cc, will be executed no matter > what. > >

Re: [racket] Unreachable line reached

2012-09-17 Thread Paulo J. Matos
On 17/09/12 18:30, Danny Yoo wrote: I have a trivial question but I desperately need a spare pair or eyes (or another brain). The 'when's here look really suspicious. You want control flow to go exclusively to one or the other path, but when you have 'when' like this: ... (when ) unl

Re: [racket] sandboxing issue while trying to print slideshow slides

2012-09-17 Thread Robby Findler
slideshow --trust ? Robby On Mon, Sep 17, 2012 at 12:35 PM, James T. Perconti wrote: > Hello, > I'm trying to make a PDF of a slideshow presentation that uses Jay > McCarthy's slideshow-latex package from PLaneT. I seem to be running up > against slideshow's sandbox: the package needs to r

Re: [racket] Delete Second

2012-09-17 Thread Danny Yoo
On Mon, Sep 17, 2012 at 11:30 AM, Ashley Fowler wrote: > I was just showing my first part lol...but here goes the rest of i below > > (define delete-second1(lambda(ls) > (if(< (length ls) 1) >(append(list(car ls))(cdr(cdr ls)) >

[racket] sandboxing issue while trying to print slideshow slides

2012-09-17 Thread James T. Perconti
Hello, I'm trying to make a PDF of a slideshow presentation that uses Jay McCarthy's slideshow-latex package from PLaneT. I seem to be running up against slideshow's sandbox: the package needs to run LaTeX and generate some image files, and so slideshow is hitting a "slide program attempted t

Re: [racket] Unreachable line reached

2012-09-17 Thread Danny Yoo
> I have a trivial question but I desperately need a spare pair or eyes (or > another brain). The 'when's here look really suspicious. You want control flow to go exclusively to one or the other path, but when you have 'when' like this: ... (when ) unless an exception occurs in the or ,

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
I was just showing my first part lol...but here goes the rest of i below (define delete-second1(lambda(ls) (if(< (length ls) 1) (append(list(car ls))(cdr(cdr ls)) list(car ls))

Re: [racket] Delete Second

2012-09-17 Thread Danny Yoo
On Mon, Sep 17, 2012 at 11:19 AM, Ashley Fowler wrote: > Yeah I got a error. > > This is what I got so far though. > > (if(< (length ls) 1)(append(list(car ls))(cdr(cdr ls))) I can't read this one-liner. I can't count parens. :) Let me break it down into a few lines:

[racket] Unreachable line reached

2012-09-17 Thread Paulo J. Matos
Hello, I have a trivial question but I desperately need a spare pair or eyes (or another brain). I have the loop: (let loop ([line (read-line in)]) (when (not (eof-object? line)) (let ([split-str (string-split line ",")]) (when (not (= (length split-

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
Yeah I got a error. This is what I got so far though. (if(< (length ls) 1)(append(list(car ls))(cdr(cdr ls))) From: danny@gmail.com [danny@gmail.com] on behalf of Danny Yoo [d...@hashcollision.org] Sent: Monday, September 17, 2012 1:15 PM To: Ash

Re: [racket] Delete Second

2012-09-17 Thread Kieron Hardy
The documentation for 'if' is here http://docs.racket-lang.org/reference/if.html?q=if Here's a slightly modified example from the doc using 'if': (if (positive? -5) (error "shouldn't get here") (display "hi")) You might want to consider the 'when', documented here http://docs.racket-lang.org

Re: [racket] Delete Second

2012-09-17 Thread Danny Yoo
> delete-second2 takes the same procedure from delete-second1, I just need to > know how to use the if expression because you have to find out if the list > has more than one item in order for it to delete anything. Ok. Let's look at the expression you had written earlier: (if (> ls 1) )

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
delete-second2 takes the same procedure from delete-second1, I just need to know how to use the if expression because you have to find out if the list has more than one item in order for it to delete anything. From: danny@gmail.com [danny@gmail.com

Re: [racket] Delete Second

2012-09-17 Thread Danny Yoo
On Mon, Sep 17, 2012 at 10:40 AM, Ashley Fowler wrote: > Basically delete-second2 has to take a input of a list, if the list has more > than 1 item then it will delete the second item and return the new list, if > it doesnt have more than 1 item it will just return the original list. Let me be

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
Basically delete-second2 has to take a input of a list, if the list has more than 1 item then it will delete the second item and return the new list, if it doesnt have more than 1 item it will just return the original list. From: danny@gmail.com [danny

Re: [racket] Delete Second

2012-09-17 Thread Danny Yoo
> 2. Write a procedure (delete-second1 LS) that takes a list LS of at > least two items and returns the same list only with the second item > deleted. You may assume the input list has at least two elements. > > Tests: > (delete-second1 '(3 7)) ==> (3) > (delete-second1 '(a b c d)) ==> (a c d)

Re: [racket] Delete Second

2012-09-17 Thread Matthias Felleisen
Are you saying the problem is not on-line? There must be some context. -- Matthias On Sep 17, 2012, at 12:22 PM, Ashley Fowler wrote: > That was the full problem. It started with #2. I'm just confused on how to > start #3. I know you have to use a if expression. > > 2. Write a procedure (del

Re: [racket] Delete Second

2012-09-17 Thread Ashley Fowler
That was the full problem. It started with #2. I'm just confused on how to start #3. I know you have to use a if expression. 2. Write a procedure (delete-second1 LS) that takes a list LS of at  least two items and returns the same list only with the second item  deleted. You may assume the input

Re: [racket] Delete Second

2012-09-17 Thread Matthias Felleisen
On Sep 17, 2012, at 12:11 PM, Ashley Fowler wrote: > I just wanna know if I am starting the procedure out right? This is what I > got so far... > (define delete-second2(lambda(ls) > (if(>ls 1) Since you're asking a yes-no question, the answer has to be 'no'. Can you point us to

[racket] Delete Second

2012-09-17 Thread Ashley Fowler
I have to write a procedure (delete-second2 LS) that takes an arbitrary list LS of items and returns the same list only with the second item deleted if there is no second item, o.w. returns original input list. I will need to use a conditional. And the tests should be as below. Tests: (delete-seco