Re: [racket-users] Trouble with "on delete cascade" using sqlite

2017-04-18 Thread Philip McGrath
Thanks, that solved it! -Philip On Tue, Apr 18, 2017 at 4:54 PM, David Storrs wrote: > IIRC, SQLite defaults to PRAGMA foreign_keys = OFF when you open a > database. Without FKs being on there is nothing for the CASCADE to trigger > on. You'll need to turn the FKs on

Re: [racket-users] Trouble with "on delete cascade" using sqlite

2017-04-18 Thread David Storrs
IIRC, SQLite defaults to PRAGMA foreign_keys = OFF when you open a database. Without FKs being on there is nothing for the CASCADE to trigger on. You'll need to turn the FKs on before it will work. Just add this line before the first 'insert into tUsers' and then it will work: (query-exec db

[racket-users] Trouble with "on delete cascade" using sqlite

2017-04-18 Thread Philip McGrath
The following program returns '(#("demo" "j...@example.com")), whereas I think it should return '(), because I expect deleting the row from "tUsers" to delete the corresponding row in "tEmail". Is this a bug in the db library (or elsewhere, or am I doing something wrong)? #lang at-exp racket

Re: [racket-users] Preventing browser frame from terminating evaluation thread?

2017-04-18 Thread Philip McGrath
I don't have an explanation (I just guessed exit was being called somewhere), but the exit handler did have an effect. The example program quit with "Interactions disabled" in DrRacket, whereas this program does not (and does display "Called exit"): #lang racket (require browser) (define

Re: [racket-users] Typed Racket error in REPL but not when command-line-loaded

2017-04-18 Thread Greg Hendershott
1. It seems maybe you're requiring typed/racket solely as a way to get assert? Instead I think you want to replace (require typed/racket) with (require rackunit), and, in your tests replace (assert (equal? x y)) with (check-equal? x y). Note this will only print something if a check-equal? test

[racket-users] Typed Racket error in REPL but not when command-line-loaded

2017-04-18 Thread Lawrence Bottorff
I'm looking at this from https://github.com/dparpyani/99-Lisp-Problems-in-Racket: #lang racket (require typed/racket) ;; Question: ;; Find the last box of a list. ;;Example: ;; (my-last '(a b c d)) ;; => '(d) ;; Consumes a list and returns the last element in it. (define (my-last

Re: [racket-users] Preventing browser frame from terminating evaluation thread?

2017-04-18 Thread Matthew Flatt
I don't think setting the exit handler will have an effect. The example application quits because an implicit `yield` finishes when the window is closed, and then the GUI handler thread has nothing else to do, so it exits. You could add an explicit `yield`, to allow events to be handled, and then

Re: [racket-users] Announcing Leibniz, a new language in the Racket universe

2017-04-18 Thread Konrad Hinsen
Alexander McLin writes: > This looks quite promising, I'm liking the progress and examples so > far. Thanks for your feedback! > I have personal interests in computational science and executable > biological models, rewriting some classical papers' models into the >