[racket-users] Re: Adding new exceptions

2016-11-28 Thread David Storrs
After sending this I realized that I could define my own exception types and use those. The original question, though, was how to get the built-in exception hierarchy expanded into something more fine-grained. On Mon, Nov 28, 2016 at 7:46 PM, David Storrs wrote: > I'm doing some "write files to

[racket-users] How do raise-argument-error and raise-result-error differ?

2016-11-28 Thread David Storrs
>From the docs for raise-result-error: "Like raise-argument-error , but the error message describe v as a “result” instead of an “argument.”" Testing: -> (raise-res

[racket-users] Adding new exceptions

2016-11-28 Thread David Storrs
I'm doing some "write files to disk" work and noticing that the exception system for the filesystem isn't terribly fine-grained. Leaving aside exceptions that pertain to Racket's module system we only have: exn:fail:filesystem (something went wrong in general) and exn:fail:filesystem:exists? (

Re: [racket-users] parameters across dynamic-require

2016-11-28 Thread Matthew Flatt
At Mon, 28 Nov 2016 17:34:26 -0800 (PST), Dan Liebgold wrote: > If I do a dynamic-require inside a (parameterize (...) ...), should the > required module receive those bound parameters? Yes. > (and if not, is there a way make that happen?) If it's not happening, then the issue might be that the

[racket-users] parameters across dynamic-require

2016-11-28 Thread Dan Liebgold
If I do a dynamic-require inside a (parameterize (...) ...), should the required module receive those bound parameters? (and if not, is there a way make that happen?) Thanks, Dan -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe

Re: [racket-users] Contract on a parameter’s value as a function precondition?

2016-11-28 Thread Scott Moore
It turns out that the continuation mark keys and procedures for parameters aren’t really hidden away, so it ended up being pretty straight forward. Below is a minimal implementation of parameterization->. I’m happy to help integrate this into the racket/contract family once we figure out what’s

Re: [racket-users] Literate program a math course with Racket?

2016-11-28 Thread Arthur Nunes-Harwitt
Dear Lawrence, You may want to check out Peter Norvig's _Paradigm's of AI Programming: Case Studies in Common LISP_. -Arthur == Arthur Nunes-Harwitt Computer Science Department, Rochester Institute of Technology Room 70-3509 585-47

Re: [racket-users] Contract on a parameter’s value as a function precondition?

2016-11-28 Thread David Storrs
Does this do what you need? (define/contract (foo bar) (-> (or/c 1 #t "bar" (listof string?) (listof (or/c 'a 'b))) boolean?) #t) (foo 1) (foo #t) (foo "bar") (foo '("should work")) (foo '(a)) (foo '(b)) (foo '(b a b a a a)) (foo "should fail") Output: #t #t #t #t #t #t #t foo: contract vio

Re: [racket-users] Contract on a parameter’s value as a function precondition?

2016-11-28 Thread Alexis King
That sounds promising, yes. Not being familiar with the guts of parameters, is there any way to implement this as a derived concept using the existing support in chaperone-procedure? As far as I can tell, parameters do not expose the continuation marks they use, and they also create thread cells, w

[racket-users] Literate program a math course with Racket?

2016-11-28 Thread Lawrence Bottorff
I'm tackling SICP -- using Racket and Emacs/orgmode, which I think is the best combination (YMMV). I like SICP because it puts computational math in the mix of learning functional programming. Then Sussman did SICM (...Classical Mechanics; 2nd edition) -- which is way over my head. But again, it

[racket-users] running dr racket on chromebook without ubuntu

2016-11-28 Thread yehoshua zaman
I have asus chromebook c100p. i am in developer mode. I installed dr racket while in developer mode by entering crosh, then typing shell then finding the location of downloads and while in that location typing racket.sh (i renamed it to racket.sh) after that i went into the directory of racket