Re: [racket-users] Question about Racket design philosophy: returning (void)

2018-04-10 Thread Yucheng Zhang
On 11 April 2018 at 06:48:49, Matthias Felleisen (matth...@felleisen.org) wrote: > Perhaps the real problem is one of the contract/type system. We have seen > effect systems > over and over again, though usually they try to express complicated > invariants and have > them checked at compile

[racket-users] Re: Question about Racket design philosophy: returning (void)

2018-04-10 Thread Jack Firth
Racket's also flexible enough that you can say "to hell with void, I want function chaining" if you decide it's more appropriate: (require fancy-app) ;; now (+ _ 1) means (lambda (v) (+ v 1)) (require point-free) ;; now (~> x f g h) means (h (g (f x))) ;; makes voidful procedures return their

Re: [racket-users] Question about Racket design philosophy: returning (void)

2018-04-10 Thread Matthias Felleisen
Alexis says that (-> vector? exact-integer? any/c void?) is better than (-> vector? exact-integer? any/c vector?) because the former clearly signals the imperative nature of the function inside of the spec while the latter could be either a read-only or a RW function. Perhaps the

Re: [racket-users] Question about Racket design philosophy: returning (void)

2018-04-10 Thread Neil Van Dyke
Alexis King wrote on 04/10/2018 03:32 PM: There is definitely a school of thought that buys into the idea of returning “the thing being operated on” rather than returning nothing for side-effectful functions. I think this is most characterized by so-called “fluent interfaces”[1], a way of

Re: [racket-users] Question about Racket design philosophy: returning (void)

2018-04-10 Thread Alexis King
> On Apr 10, 2018, at 14:00, David Storrs > wrote: > > Aside from I/O, I can't think of too many cases where (void) is the > intuitively correct or most useful return value, but it is extremely > common throughout the built-in Racket functions. I'm not sure where >

Re: [racket-users] Question about Racket design philosophy: returning (void)

2018-04-10 Thread David Storrs
On Tue, Apr 10, 2018 at 1:18 PM, Neil Van Dyke wrote: > Good catch; I agree that it would be better if `gzip` returned the target > path, in all cases. > > There is another change I'd make to that signature: currently, arg > `out-file` is optional, of type `path-string?`,

Re: [racket-users] IEEE 754 single precision float support

2018-04-10 Thread dkim
> > Then you probably want SIMD vector ops too, which, AFAIK, are not yet > supported. FP math in Racket does use the SIMD unit on most targets, > but normal math computes one value at a time, using only one slot per > SIMD register, as opposed to the N slots available at the given precision.

Re: [racket-users] Question about Racket design philosophy: returning (void)

2018-04-10 Thread Neil Van Dyke
Good catch; I agree that it would be better if `gzip` returned the target path, in all cases. There is another change I'd make to that signature: currently, arg `out-file` is optional, of type `path-string?`, defaulting to `(path-add-extensionin-file".gz"#".")`.  In a backward-compatible way,

[racket-users] Question about Racket design philosophy: returning (void)

2018-04-10 Thread David Storrs
A lot of functions in Racket return (void) instead of a useful value. One example is the gzip function from file/gzip; it would be useful if this returned the filepath to which the file was compressed, but instead it simply returns (void). I have a lot of respect for Racket and its designers, so

Re: [racket-users] PLT Redex & dependent type

2018-04-10 Thread Ning Shan
It is very helpful to me. You are so nice! Thank you very much! On Tuesday, April 10, 2018 at 9:35:31 PM UTC+8, William J. Bowman wrote: > > FYI, I have some other models here: > - A model of Luo's ECC, a much smaller model than CIC: > https://github.com/wilbowma/ecc-redex > - A couple of

Re: [racket-users] PLT Redex & dependent type

2018-04-10 Thread 'William J. Bowman' via Racket Users
FYI, I have some other models here: - A model of Luo's ECC, a much smaller model than CIC: https://github.com/wilbowma/ecc-redex - A couple of experimental models, including a model with just Π, and failed attempt (IIRC) to model Hoare Type Theory: https://github.com/wilbowma/dep-types-101

Re: [racket-users] typed/racket surprises

2018-04-10 Thread Sam Tobin-Hochstadt
On Mon, Apr 9, 2018 at 5:08 PM, Philip McGrath wrote: > Thanks for your helpful reply. I've created GitHub issues > https://github.com/racket/typed-racket/issues/691 and > https://github.com/racket/typed-racket/issues/692 to track the bugs, and I > will try my hand at a

[racket-users] Re: error in DrRacket but not in script

2018-04-10 Thread Frédéric Morain-Nicolier
Yes, that's that ! Many thanks, also for providing the suggestion. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com.

[racket-users] Re: error in DrRacket but not in script

2018-04-10 Thread Alexander McLin
My guess the problem is (define imleftname #"./tsukubaleft.jpg") You're using a relative path to the jpg file which may be valid wherever your script file is located but DrRacket is probably starting up with a different working directory and the relative path is not resolving successfully.

[racket-users] Re: [racket] Dr. Racket for iOS

2018-04-10 Thread Mark Dymek
Has this been looked into again? Especially now that we have Swift playgrounds and the iPad Pro. The iPad Pro would be my pc if only it had a racket/scheme programming environment. I’ve found a few gambit is no longer kept up to date meaning it’s not optimized for the Pro and iOS 11. I

Re: [racket-users] PLT Redex & dependent type

2018-04-10 Thread 'William J. Bowman' via Racket Users
Yes. https://github.com/wilbowma/cic-redex This isn't exactly a minimal example; I have a smaller model somewhere I'll try to send. -- Sent from my phoneamajig > On Apr 10, 2018, at 06:32, Ning Shan wrote: > > Can I implement dependent type in PLT Redex? >

[racket-users] PLT Redex & dependent type

2018-04-10 Thread Ning Shan
Can I implement dependent type in PLT Redex? https://en.wikipedia.org/wiki/Dependent_type Specifically Pi type. Can anyone give me a reference or a minimal example? Thanks in advance. :-) -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To

Re: [racket-users] IEEE 754 single precision float support

2018-04-10 Thread George Neuner
On 4/10/2018 1:36 AM, d...@insomniacgames.com wrote: For the applications I work on, double precision floats are too costly to use; although the CPU cycle count to operate on doubles tend to be the same as single precision floats on modern hardware, the bandwidth cost is too prohibitive. We

[racket-users] error in DrRacket but not in script

2018-04-10 Thread Frédéric Morain-Nicolier
Hello, I'm just a beginner in Racket and want to use the opencv bindings. I have this small basic code : #! /usr/bin/env racket #lang racket/base (require opencv/highgui) ; lecture des deux images et affichage (pour tester) (define imleftname #"./tsukubaleft.jpg") (define im-left