[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-janitors] #1041: -d0 causes different application behavior
From: |
Chicken Trac |
Subject: |
Re: [Chicken-janitors] #1041: -d0 causes different application behavior |
Date: |
Tue, 30 Jul 2013 14:50:11 -0000 |
#1041: -d0 causes different application behavior
-----------------------+----------------------------------------------------
Reporter: mario | Owner:
Type: defect | Status: new
Priority: critical | Milestone: 4.9.0
Component: unknown | Version: 4.8.x
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Comment(by mario):
Here's a shorter test case that can be used to reproduce the problem:
{{{
$ cat test.scm
(use awful spiffy)
;; just create a test file:
(with-output-to-file "file.txt" (cut print "file.txt"))
(define (app)
(define (foo-matcher req-path)
(and (equal? req-path "/foo-page")
(list req-path)))
(define-page foo-matcher
(lambda (req-path)
req-path))
(define (bar-matcher req-path)
(and (equal? req-path "/bar-page")
(list req-path)))
(define-page bar-matcher
(lambda (req-path)
(lambda ()
(send-static-file "file.txt"))))
) ;; end app
(awful-start app dev-mode?: #t)
}}}
Expected behavior:
{{{
$ csc test.scm && ./test
$ curl http://localhost:8080/foo-page
<html><head></head><body>/foo-page</body></html>
}}}
Unexpected behavior (compiling with {{{-no-lambda-info}}}):
{{{
$ csc -no-lambda-info test.scm && ./test
$ curl http://localhost:8080/foo-page
file.txt
}}}
If I replace the handler for the bar-page from
{{{
(lambda (req-path)
(lambda ()
(send-static-file "file.txt")))
}}}
to
{{{
(lambda (req-path)
req-path)
}}}
I get the expected result, i.e.,
{{{
curl http://localhost:8080/foo-page
<html><head></head><body>/foo-page</body></html>
}}}
--
Ticket URL: <http://bugs.call-cc.org/ticket/1041#comment:2>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.