Re: [racket-users] Crash when installing 'boris' package from GitHub URL on OSX 10.6.8

2015-12-10 Thread David K. Storrs
On Thursday, December 10, 2015 at 4:05:02 AM UTC-8, Matthew Flatt wrote: > I've pushed a repair for the crash, which was due to a bug in the new > macro expander. > > The "boris/hypertext-browser/http/head.rkt" module creates a pattern of > binding and shadowing that had never been exercised

[racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Klaus Ostermann
This Typed Racket term is well-typed: (+ 1 (if (= 0 (- 1 1)) 1 "x")) This one isn't: (+ 1 (if (= 0 (- 2 2)) 1 "x")) This looks a bit strange to me, because usually one would expect well-typedness to be not destroyed by replacing "equals with equals". I'd like to know the rationale for this

[racket-users] [Racket] Bug with Abstraction Teachpack, posn and BSL with List Abbreviations

2015-12-10 Thread Jonathan Brachthäuser
In DrRacket 6.2.1 when using the `match` construct as defined in the abstraction teachpack together with posn a strange problem appears. When choosing BSL as language the following code just works as expected: ``` (require 2htdp/abstraction) (match (make-posn 1 2) [(posn x y) (+ x y)]) ```

Re: [racket-users] Crash when installing 'boris' package from GitHub URL on OSX 10.6.8

2015-12-10 Thread Neil Van Dyke
'John Clements' via Racket Users wrote on 12/10/2015 01:04 PM: However, it could easily be the case that a package (presumably from Neil Van Dyke) could contain code that would be installed into the html subdirectory of the sxml collection, and I’m guessing that’s what you’re referring to.

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Sam Tobin-Hochstadt
On Thu, Dec 10, 2015 at 2:26 PM Klaus Ostermann wrote: > > I don't think any typed language respects this. For example: > > > >(if (= 1 1) #f "not a boolean") > > > > is equal to #f, but many type systems do not let you replace #f with > > that expression. > > But in

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Paolo Giarrusso
On Thursday, December 10, 2015 at 8:26:02 PM UTC+1, Klaus Ostermann wrote: > > I don't think any typed language respects this. For example: > > > >(if (= 1 1) #f "not a boolean") > > > > is equal to #f, but many type systems do not let you replace #f with > > that expression. > > But in

Re: [racket-users] Crash when installing 'boris' package from GitHub URL on OSX 10.6.8

2015-12-10 Thread David K. Storrs
I have to say, the fact that installing a package === using a package is really cool. Go Racket! -- 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

Re: [racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Gustavo Massaccesi
IIRC, the only numeric type that are singletons are Zero and One, so this also typechecks: (+ 1 (if (= 0 (- 0 0)) 1 "x")) On a related note, the (untyped)Racket optimizer has constant folding, so in (untyped)Racket all these expressions are compiled to 2. I don't know if it's possible to add

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Klaus Ostermann
Thanks for the clarification, Sam. What you write makes sense. However, since the default case (without explicit annotations) is that I get these very (too?) precise singleton types, I have the impression that reasoning about (typed) program equivalence is more difficult in TR than in standard

Re: [racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Vincent St-Amour
On Thu, 10 Dec 2015 13:18:57 -0600, Gustavo Massaccesi wrote: > > IIRC, the only numeric type that are singletons are Zero and One, so > this also typechecks: > > (+ 1 (if (= 0 (- 0 0)) 1 "x")) There's a few more, actually, like the various floating-point zeroes. > On a related note, the

Re: [racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Vincent St-Amour
On Thu, 10 Dec 2015 13:10:04 -0600, Paolo Giarrusso wrote: > > On Thursday, December 10, 2015 at 6:55:28 PM UTC+1, johnbclements wrote: > > > On Dec 10, 2015, at 9:50 AM, George Neuner wrote: > > > > > > On Thu, 10 Dec 2015 12:35:34 -0500, Alex Knauth wrote: > > > > > >> In typed racket (- 1

Re: [racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Paolo Giarrusso
On Thursday, December 10, 2015 at 6:55:28 PM UTC+1, johnbclements wrote: > > On Dec 10, 2015, at 9:50 AM, George Neuner wrote: > > > > On Thu, 10 Dec 2015 12:35:34 -0500, Alex Knauth wrote: > > > >> In typed racket (- 1 1) and (- 2 2) are equal at runtime, but the type > >> checker doesn't

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Klaus Ostermann
> I don't think any typed language respects this. For example: > >(if (= 1 1) #f "not a boolean") > > is equal to #f, but many type systems do not let you replace #f with > that expression. But in statically typed languages you usually have a typed equivalence relation like \Gamma |- t1

Re: [racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Paolo Giarrusso
On Thursday, December 10, 2015 at 9:11:00 PM UTC+1, Vincent St-Amour wrote: > Right. That's why we've built tools to get information about these types > more digestible: > > http://docs.racket-lang.org/ts-reference/Exploring_Types.html Thanks, I'd seen those but forgot the non-verbose

Re: [racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Asumu Takikawa
On 2015-12-10 14:02:55 -0600, Vincent St-Amour wrote: > My dream is that, instead, the Racket compiler could make its own > analyses and transformations available as hooks, just as it makes other > kinds of hooks available. :) Think of it as a "cp0 [1] as a library", > that #langs and language

Re: [racket-users] Re: [Racket] Bug with Abstraction Teachpack, posn and BSL with List Abbreviations

2015-12-10 Thread Vincent St-Amour
I just merged Paolo's fix. The fix should be in the next release. If you want to try it before that, you can either try building from source, or using a nightly build tomorrow: pre.racket-lang.org Vincent On Thu, 10 Dec 2015 12:44:39 -0600, Paolo Giarrusso wrote: > > On Thursday, December

Re: [racket-users] Re: [Racket] Bug with Abstraction Teachpack, posn and BSL with List Abbreviations

2015-12-10 Thread Jonathan Brachthäuser
That was quick. Thanks a lot Paolo and Vincent! Jonathan > On 10 Dec 2015, at 22:11, Vincent St-Amour > wrote: > > I just merged Paolo's fix. The fix should be in the next release. > > If you want to try it before that, you can either try building from >

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Matthias Felleisen
On Dec 10, 2015, at 3:04 PM, Klaus Ostermann wrote: > Thanks for the clarification, Sam. What you write makes sense. > > However, since the default case (without explicit annotations) is that I get > these very (too?) precise singleton types, I have the impression that >

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Hendrik Boom
On Thu, Dec 10, 2015 at 07:22:40PM -0500, Matthias Felleisen wrote: > > On Dec 10, 2015, at 3:04 PM, Klaus Ostermann wrote: > > > Thanks for the clarification, Sam. What you write makes sense. > > > > However, since the default case (without explicit annotations) is that I

Re: [racket-users] [Racket] Bug with Abstraction Teachpack, posn and BSL with List Abbreviations

2015-12-10 Thread Matthias Felleisen
On Dec 10, 2015, at 1:15 PM, Jonathan Brachthäuser wrote: > In DrRacket 6.2.1 when using the `match` construct as defined in the > abstraction teachpack together with posn a strange problem appears. > > When choosing BSL as language the following code just works as

Re: [racket-users] [Racket] Bug with Abstraction Teachpack, posn and BSL with List Abbreviations

2015-12-10 Thread Matthias Felleisen
Never mind! Write this off to my forgetful old age. This one is supposed to work for BSL and BSL+. I had forgotten that I fixed this. (There are other parts of 2htdp/abstraction that work only when functions are available as values.) On Dec 10, 2015, at 5:56 PM, Matthias Felleisen

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Matthias Felleisen
> On Dec 10, 2015, at 4:47 PM, Hendrik Boom wrote: > > On Thu, Dec 10, 2015 at 07:22:40PM -0500, Matthias Felleisen wrote: >> >> On Dec 10, 2015, at 3:04 PM, Klaus Ostermann wrote: >> >>> Thanks for the clarification, Sam. What you write makes

Re: [racket-users] Crash when installing 'boris' package from GitHub URL on OSX 10.6.8

2015-12-10 Thread Matthew Flatt
I've pushed a repair for the crash, which was due to a bug in the new macro expander. The "boris/hypertext-browser/http/head.rkt" module creates a pattern of binding and shadowing that had never been exercised before --- at least not in code saved in bytecode form. (It took me much longer to

[racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread George Neuner
On Thu, 10 Dec 2015 12:35:34 -0500, Alex Knauth wrote: >In typed racket (- 1 1) and (- 2 2) are equal at runtime, but the type >checker doesn't necessarily know that at compile time. It knows that >(- 1 1) is zero because that's a special case in the type system. But it

[racket-users] Re: [Racket] Bug with Abstraction Teachpack, posn and BSL with List Abbreviations

2015-12-10 Thread Paolo Giarrusso
On Thursday, December 10, 2015 at 7:15:07 PM UTC+1, Jonathan Brachthäuser wrote: > In DrRacket 6.2.1 when using the `match` construct as defined in the > abstraction teachpack together with posn a strange problem appears. > > When choosing BSL as language the following code just works as

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread 'John Clements' via Racket Users
> On Dec 10, 2015, at 9:26 AM, Klaus Ostermann wrote: > > This Typed Racket term is well-typed: > > (+ 1 (if (= 0 (- 1 1)) 1 "x")) > > This one isn't: > > (+ 1 (if (= 0 (- 2 2)) 1 "x")) > > This looks a bit strange to me, because usually one would expect >

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Robby Findler
On Thu, Dec 10, 2015 at 11:26 AM, Klaus Ostermann wrote: > This looks a bit strange to me, because usually one would expect > well-typedness to be not destroyed by replacing "equals with equals". I don't think any typed language respects this. For example: (if (= 1 1) #f

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Alex Knauth
In typed racket (- 1 1) and (- 2 2) are equal at runtime, but the type checker doesn't necessarily know that at compile time. It knows that (- 1 1) is zero because that's a special case in the type system. But it doesn't have a special case for (- 2 2), so it only knows that that's a Fixnum.

Re: [racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Vincent St-Amour
Right. The key distinction here is that TR is not so much reasoning about constants, but about a singleton type. So TR is still working in terms of types, not in terms of concrete values. Vincent On Thu, 10 Dec 2015 11:55:24 -0600, 'John Clements' via Racket Users wrote: > > > > On Dec 10,

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Hendrik Boom
On Thu, Dec 10, 2015 at 08:25:11PM -0500, Matthias Felleisen wrote: > > > > On Dec 10, 2015, at 4:47 PM, Hendrik Boom wrote: > > > > On Thu, Dec 10, 2015 at 07:22:40PM -0500, Matthias Felleisen wrote: > >> > >> On Dec 10, 2015, at 3:04 PM, Klaus Ostermann

Re: [racket-users] Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Matthias Felleisen
You may want to read our papers on Units, Harper/Lillibridge and Leroy both from POPL ’94 and chase the citations forward. But perhaps Reynolds’s old saying “type structure is a syntactic discipline for enforcing levels of abstraction” suffices — Matthias (yes, I have studied all of this too

Re: [racket-users] Crash when installing 'boris' package from GitHub URL on OSX 10.6.8

2015-12-10 Thread 'John Clements' via Racket Users
> On Dec 9, 2015, at 10:59 PM, David K. Storrs wrote: > > On Wednesday, December 9, 2015 at 6:33:02 PM UTC-8, Neil Van Dyke wrote: >> David K. Storrs wrote on 12/09/2015 08:50 PM: >>> 1) Is there a web-spidering package that people recommend? I could use >>> wget and

[racket-users] Re: Is there a way to return no value?

2015-12-10 Thread Matthew Butterick
Answer: Yes, if you redefine nothingness. You can exploit the fact that appending (or splicing) an empty list will cause it to disappear (meaning, no # residue). #lang racket (require rackunit) (define (foo-3 x) (if (eq? x "foo") (list #t) empty)) (check-equal? (append-map foo-3 '(a b "foo"

[racket-users] Is there a way to return no value?

2015-12-10 Thread David K. Storrs
Question: Is there a way to make a function return nothing -- not '() or #void, but actually nothing? I'm playing around with HTML parsing as a learning exercise. The current exercise is writing a look-down function which can be handed an HTML value produced by the html library and a