Re: [racket] Strange Behavior around memq、memv、and member

2013-12-30 Thread Justin Zamora
Your comment says that y-or-n? returns either #t or #f. I see the line where you return #t. Where do you return #f? Justin On Dec 30, 2013 4:04 PM, "亀田馬志" wrote: > Hello. > > I think I understand how memq, memv, member works: > > > (memq 'y '(y yes n no)) > '(y yes n no) > > (memq 'n '(y yes n n

Re: [racket] Strange Behavior around memq、memv、and member

2013-12-30 Thread Matthias Felleisen
Recursion isn't the problem. Your use of it is, however. Replace it with "arg" and see what happens. On Dec 30, 2013, at 4:33 PM, 亀田馬志 wrote: > Yes. Actually I try making an old-fashoned game, like Lemonade Stand on Apple > ][, and this is a part of the code. It controls input of th

Re: [racket] Strange Behavior around memq、memv、and member

2013-12-30 Thread Matthias Felleisen
On Dec 30, 2013, at 4:03 PM, 亀田馬志 wrote: > (require srfi/13) > > (define (yes-or-no? arg) > ; expected it returns #t or #f > ; depending on input such as yes or no > (letrec ((y-or-n? > ; if argument is either Y or YES, > ; it returns #t otherwise #f >

[racket] Strange Behavior around memq、memv、and member

2013-12-30 Thread 亀田馬志
Hello. I think I understand how memq, memv, member works: > (memq 'y '(y yes n no)) '(y yes n no) > (memq 'n '(y yes n no)) '(n no) > (memq 'racket '(y yes n no)) #f > By the way, I wrote a procedure as follows: (require srfi/13) (define (yes-or-no? arg) ; expected it returns #t or #f ; de

Re: [racket] strange behavior with class/c, class, and define/contract---user error or Racket bug?

2013-06-23 Thread Matthias Felleisen
On Jun 23, 2013, at 1:05 PM, Christopher wrote: > However, this does NOT work as expected (changed class/c keyword from "field" > to "init"): > > #lang racket > > (define/contract my-string% > (class/c (init [string-thing string?])) > (class object% > (super-new))) > > (print (new my-

[racket] strange behavior with class/c, class, and define/contract---user error or Racket bug?

2013-06-23 Thread Christopher
Racketeers, If I were 100% sure this was a bug, I might pass this on to the Racket developer list or some other collective with responsibility for correcting errant behavior, but being a new Racket user, I could easily just be ignorant of how the syntactic handlers involved are supposed to work

Re: [racket] strange behavior

2012-01-31 Thread Matthias Felleisen
Let me suggest this: #lang racket (define (main-of-your-program) (displayln (my-gensym)) (displayln (my-gensym))) (define my-gensym 0) ;; --- test: (require (only-in mzscheme fluid-let)) (define (generate-a-predictable-symbol) 'a0) (fluid-let ((my-gensym generate-a-predictable-symbol))

Re: [racket] strange behavior

2012-01-31 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 31-01-12 13:38, zermelo wrote: > I have the following problem. I want to replace procedure gensym > with a mock to test a piece of software with predictable gensym > values. When this is done, I restore the old gensym. Thus I wrote > this code in ra

[racket] strange behavior

2012-01-31 Thread zermelo
I have the following problem. I want to replace procedure gensym with a mock to test a piece of software with predictable gensym values. When this is done, I restore the old gensym. Thus I wrote this code in racket: (define old-gensym gensym) (define gensym ) ...test... (define gensym old-gensy

Re: [racket] Strange behavior of web application , or may be not

2011-06-27 Thread Jay McCarthy
There's also send/back, which sends a single response. Jay 2011/6/27 Veer : > This is  really crazy , I wrote large program , and was getting > the same behavior and whole day I tried to figure why and why me? > Of course I forgot that response/xexpr does not > send the response back to client. >

Re: [racket] Strange behavior of web application , or may be not

2011-06-27 Thread Veer
This is really crazy , I wrote large program , and was getting the same behavior and whole day I tried to figure why and why me? Of course I forgot that response/xexpr does not send the response back to client. So view function becomes : (define (view request) (send/suspend/dispatch (lam

Re: [racket] Strange behavior of web application , or may be not

2011-06-27 Thread Jay McCarthy
This is not strange. When you click "Create Something", the continuation is [] When you click "Start Again", the continuation is (begin [] (error 'oops ...) (recur)) When you click "View", the value (response/xexpr `(html)) gets returned to the continuation, so you get an error, because

[racket] Strange behavior of web application , or may be not

2011-06-27 Thread Veer
Hello, When I run this web application (given below) , I get strange behavior , don't know if this is correct behavior or not. Follow/click the link in sequence : 1. Create Something 2. Start again 3. View So , when I click "view" I get exception instead of blank page. code : #lang web-server/