Re: [racket-dev] Fwd: Q. about Directly Reflective paper
IMO, this is what one should expect from someone when an error is pointed out in their paper. It is a bit surprising to me that something like that got thru at HOSC, of all places, tho. Robby On Tue, Nov 16, 2010 at 11:41 PM, John Clements cleme...@brinckerhoff.org wrote: Well, he's generous about it; here's what he had to say. John Begin forwarded message: From: Aaron Stump aaron-st...@uiowa.edu Date: November 16, 2010 5:58:42 PM PST To: John Clements cleme...@brinckerhoff.org Subject: Re: Q. about Directly Reflective paper Reply-To: ast...@cs.uiowa.edu Hi, John. I think you are right about this. Lambda abstractions evaluate to #procedures in Scheme R5RS, and so it is not possible to take a cdr or car of one of these. I have no idea why I wrote this (four years ago -- there was a major lag between acceptance and publication at HOSC). I will add a note to my web page about this, and possibly upload a revised version of the paper without this incorrect statement. Aaron On Tue, Nov 16, 2010 at 4:18 PM, John Clements cleme...@brinckerhoff.org wrote: I'm reading your paper, Directly Reflective Meta-Programming, and I got stuck early on a remark of yours about Scheme: A meta-programming language is scope safe (or hygienic) iff variables may not be captured or escape their scopes during computation. Dynamic variables in Emacs LISP and Common LISP are a good example of a violation of scope safety [30, 24]. Scheme R5RS’s macro language is designed to be scope safe [21]. Other constructs in Scheme R5RS, however, enable violation of scope safety, even though the language does not have dynamic variables. For a violation of scope safety in spirit, though not technically, we have that (caddr ’(lambda (x) x)) evaluates to x. According to the R5RS language definition, ’(lambda (x) x) is a literal expression, and hence the occurrences of x in it are not variables at all, but just (unscoped) literal data. So in this example, a variable has been created (namely, the resulting unquoted x), but not by means of removing it from its scope. Using quasiquotation, however, the example may be modified to give a true violation of scope safety. The following expression extracts the variable x from its scope, by transforming the binding lambda expression into a piece of literal data, and then extracting and evaluating the quoted variable. ((lambda (y) (eval ‘(car (cdr (cdr ’,y) (lambda (x) x)) This looks pretty goofy to me. Do you know of R5RS implementations that actually allow you to peel apart a 3d value like this? Racket (nee MzScheme) certainly doesn't. Thanks! John Clements _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] Fwd: Q. about Directly Reflective paper
Someone should write to Danvy and ask him what the heck HE was doing sleeping on the job. How could a paper on a topic like this not get a proper Schemer as a reviewer and, if so, why didn't they, uh, read the paper? On Wed, Nov 17, 2010 at 12:41 AM, John Clements cleme...@brinckerhoff.org wrote: Well, he's generous about it; here's what he had to say. John Begin forwarded message: From: Aaron Stump aaron-st...@uiowa.edu Date: November 16, 2010 5:58:42 PM PST To: John Clements cleme...@brinckerhoff.org Subject: Re: Q. about Directly Reflective paper Reply-To: ast...@cs.uiowa.edu Hi, John. I think you are right about this. Lambda abstractions evaluate to #procedures in Scheme R5RS, and so it is not possible to take a cdr or car of one of these. I have no idea why I wrote this (four years ago -- there was a major lag between acceptance and publication at HOSC). I will add a note to my web page about this, and possibly upload a revised version of the paper without this incorrect statement. Aaron On Tue, Nov 16, 2010 at 4:18 PM, John Clements cleme...@brinckerhoff.org wrote: I'm reading your paper, Directly Reflective Meta-Programming, and I got stuck early on a remark of yours about Scheme: A meta-programming language is scope safe (or hygienic) iff variables may not be captured or escape their scopes during computation. Dynamic variables in Emacs LISP and Common LISP are a good example of a violation of scope safety [30, 24]. Scheme R5RS’s macro language is designed to be scope safe [21]. Other constructs in Scheme R5RS, however, enable violation of scope safety, even though the language does not have dynamic variables. For a violation of scope safety in spirit, though not technically, we have that (caddr ’(lambda (x) x)) evaluates to x. According to the R5RS language definition, ’(lambda (x) x) is a literal expression, and hence the occurrences of x in it are not variables at all, but just (unscoped) literal data. So in this example, a variable has been created (namely, the resulting unquoted x), but not by means of removing it from its scope. Using quasiquotation, however, the example may be modified to give a true violation of scope safety. The following expression extracts the variable x from its scope, by transforming the binding lambda expression into a piece of literal data, and then extracting and evaluating the quoted variable. ((lambda (y) (eval ‘(car (cdr (cdr ’,y) (lambda (x) x)) This looks pretty goofy to me. Do you know of R5RS implementations that actually allow you to peel apart a 3d value like this? Racket (nee MzScheme) certainly doesn't. Thanks! John Clements _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] [racket] newbie: foreign C structure definition question
On Wed, Nov 17, 2010 at 2:12 AM, Eli Barzilay e...@barzilay.org wrote: Two hours ago, Sam Tobin-Hochstadt wrote: Python's 'ctypes' library, which also uses libffi under the hood, has arrays: http://docs.python.org/library/ctypes.html#arrays and also unions, which we don't have: http://docs.python.org/library/ctypes.html#structures-and-unions So it seems like this should be possible, and maybe we can even use their code. They guy who did ctypes knows how to deal with the libffi internals. (He did the msvc version of the code.) If you look through the libffi documentation you'll see no mention of arrays, and an explicit mention of no special support for unions. I understand that, but ctypes proves 3 things - it can be done - there is code to read and people to ask to figure out how - Python(!) has a nicer FFI than us for this. -- sam th sa...@ccs.neu.edu _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] [racket] newbie: foreign C structure definition question
6 hours ago, Jay McCarthy wrote: I may be parsing your responses wrong Eli, but I don't think we should let our use of libffi be a barrier to a good ffi. I see (require ffi) to mean get a good Racket FFI, not get a Racket encoding of libffi. Of course. I even detailed a number of times how it could be done: what you need is to find a hook in libffi that allows you to create new types with a manually specified size and alignment, then use that from the racket side. That does require some digging, but it sounds like Sam has already done some, so you just need to wait for a patch from him. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
[racket-dev] Fwd: Re: [plt-scheme] Recommended style for ncurses ffi?
Original Message Subject:Re: [plt-scheme] Recommended style for ncurses ffi? Date: Tue, 16 Nov 2010 13:47:59 -0600 From: Michael Forster m...@sharedlogic.ca To: Kevin Tew t...@cs.utah.edu On Thu, Nov 11, 2010 at 10:11 PM, Kevin Tewt...@cs.utah.edu wrote: How far along did you get with your ncurses impl? Would you be willing to put it on github? Kevin Tew Hi Kevin, Not too far before we encountered reliability problems with PLT Scheme in our 64bit FreeBSD deployment environment. We posted a bug report and core stack trace to PLT regarding the segfaults and socket disconnects we were receiving, but it was closed as being an os problem. However, since that environment runs several applications written in various versions each of Common Lisp, Haskell, and OCaml -- all without a single segfault or other serious failure -- we had to dump PLT Scheme. Too bad. We did like PLT Scheme, but business demanded that we move on. Regards, Mike _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
[racket-dev] error in gr2
/Users/matthias/plt/collects/mred/private/wx/common/freeze.rkt:9:0 internal-error /Users/matthias/plt/collects/mred/private/wx/common/freeze.rkt:36:0 constrained-reply /Users/matthias/plt/collects/mred/private/wx/cocoa/window.rkt:151:2 /Users/matthias/plt/collects/mred/private/wx/cocoa/utils.rkt:66:0 call-with-autorelease /Users/matthias/plt/collects/ffi/unsafe/try-atomic.rkt:24:0 call-as-nonatomic-retry-point /Users/matthias/plt/collects/mred/private/wx/cocoa/queue.rkt:313:39 /Users/matthias/plt/collects/mred/private/wx/common/queue.rkt:361:7 /Users/matthias/plt/collects/mred/private/wx/common/queue.rkt:398:26 internal error: wrong eventspace for constrained event handling /Users/matthias/plt/collects/mred/private/wx/common/freeze.rkt:9:0 internal-error /Users/matthias/plt/collects/mred/private/wx/common/freeze.rkt:36:0 constrained-reply /Users/matthias/plt/collects/mred/private/wx/cocoa/window.rkt:148:2 /Users/matthias/plt/collects/mred/private/wx/cocoa/utils.rkt:66:0 call-with-autorelease /Users/matthias/plt/collects/ffi/unsafe/try-atomic.rkt:24:0 call-as-nonatomic-retry-point /Users/matthias/plt/collects/mred/private/wx/cocoa/queue.rkt:313:39 /Users/matthias/plt/collects/mred/private/wx/common/queue.rkt:361:7 /Users/matthias/plt/collects/mred/private/wx/common/queue.rkt:398:26 I killed an execution with cmd-K. I tried to close the window with cmd-W. The above shows up in the console. It seems repeatable but I don't have time to check it out. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] Tab switching keyboard shortcuts on Mac
On Nov 14, 2010, at 1:35 PM, Dmitry Chestnykh wrote: On Sun, 14 Nov 2010, Robby Findler wrote: Currently, DrRacket uses cmd-[ and cmd-] and it seems unfortunate to have to change that by adding another modifier. I see that terminal uses that for cycling windows, and safari and firefox use it for the browsing history. Preview uses it for changing pages. So cmd-[ and cmd-] don't seem all that standard. Well, it seems like Cmd+SHIFT+[ and ] also work for me in 5.0.2 (can't get any keyboard shortcuts to work in the nightly build :). Anyway, the most important thing for me was a conflict with the standard text editing shortcuts, and you fixed it, so I'm okay with any shortcuts for tab switching (I also use Cmd+1..9, and they work well). There's another unrelated thing with shortcuts that bothers me -- any shortcuts with letters don't work with non-English (Russian in my case) layouts -- they put a letter instead of doing action (for example, if I press Cmd+] with Russian layout, it outputs ъ, because that's what ] is mapped to in this layout). As I understand, normally, when modifier keys are pressed (for example, Cmd) the app should receive English letters, but it seems like it's not the case for DrRacket. I'll look into it more, and let you know if I come out with the fix (or maybe the Cocoa version won't even have this bug). FWIW, Chrome seems to use Cmd+Option+Left and Cmd+Option+Right. John smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev