Re: [racket-users] How can I make an app that quits?

2017-02-21 Thread Byron Davies
Thank you. The direct approach worked. While I really do want to learn about custodians, I’ll leave that for another day. > On Feb 21, 2017, at 12:38 PM, Matthew Flatt wrote: > > Probably the more direct path in this case is to call > `application-quit-handler` to install

Re: [racket-users] intensional equality and unit tests

2017-02-21 Thread 'John Clements' via Racket Users
> On Feb 21, 2017, at 1:01 PM, Gustavo Massaccesi wrote: > > I'm not sure if this changed. To get a #t with equal? you can add > #:transparent . But be careful because #:transparent is more powerful > than what I expected. For example, it makes available the constructor > of

Re: [racket-users] intensional equality and unit tests

2017-02-21 Thread Gustavo Massaccesi
I'm not sure if this changed. To get a #t with equal? you can add #:transparent . But be careful because #:transparent is more powerful than what I expected. For example, it makes available the constructor of the struct. #lang racket (define-struct foo (a b)) (make-foo 3 4) ; ==>

Re: [racket-users] How can I make an app that quits?

2017-02-21 Thread Matthew Flatt
Probably the more direct path in this case is to call `application-quit-handler` to install a callback for when the "Quit" menu item is selected, and the callback could call `(exit)`. At Tue, 21 Feb 2017 13:51:17 -0500, Matthias Felleisen wrote: > > Run your app’s threads in a custodian, and

Re: [racket-users] Can raco distribute produce a single executable?

2017-02-21 Thread Ethan Estrada
On Monday, February 20, 2017 at 12:33:46 PM UTC-7, lu wrote: > In fact, I'm wondering if `raco distribute` or `raco exe` is flexible enough > to produce a statically linked executable where all the necessary dlls are > incorporated. I believe this is possible, but probably not worth the effort

Re: [racket-users] How can I make an app that quits?

2017-02-21 Thread Matthias Felleisen
Run your app’s threads in a custodian, and make sure to shut down this custodian when you discover that the user has clicked on any ‘quit button’. Something like (class frame% (super-new) (inherit move resize) (define/augment (on-close)

[racket-users] How can I make an app that quits?

2017-02-21 Thread Byron Davies
I successfully built a Mac app, called BlackSwan, using raco exe and raco distribute. I was able to distribute it to beta testers and it worked perfectly — until the user tries to quit out of it. I haven’t added any menus to the app, but it comes up with a BlackSwan menu with About,

Re: [racket-users] Programming paradigms

2017-02-21 Thread David Storrs
On Mon, Feb 20, 2017 at 10:18 PM, Rusi Mody wrote: > On Thursday, February 16, 2017 at 9:46:53 PM UTC+5:30, David K. Storrs > wrote: > > I find PP to be a useful tool for thinking about programming, but not > terribly significant in everyday use -- my code will typically

Re: [racket-users] generate sentences

2017-02-21 Thread Nguyen Linh Chi
Thank you Matthias, It seems that you all have developed a well structured path of programming experience for beginners. Great! Coding can be somewhat therapeutic, i start to think so. I'll check (and complain later :) Good day everyone ! On Feb 21, 2017 15:32, "Matthias Felleisen"

Re: [racket-users] Re: get-file-list filter

2017-02-21 Thread David Storrs
You can also, as you pointed out, generate the string programmatically. If you do, you'll get mileage out of the string-upcase and string-downcase functions: (define basestr (string-join (map string-downcase '(...jpg jpeg etc)) ";") (define str (string-append basestr ";" (string-upcase

Re: [racket-users] generate sentences

2017-02-21 Thread Matthias Felleisen
Dear Linh Chi, the exercise is basically Lab 7 from the last instance of the Northeastern beginners course: http://www.ccs.neu.edu/course/cs2500f16/lab7.html If you work through this lab, you will get a performant solution based on lists. Once you have that, it should be fairly obvious

[racket-users] generate sentences

2017-02-21 Thread Linh Chi Nguyen
hello, i'm doing this exercise and would appreciate any comments. i want to create a machine to scan a text, then split the text into elements (storing in a hash table). then we connect these hash keys in a probabilistic way, so that if we start from a word, we can jump to other words in a