[racket-users] Higher-order units

2018-10-17 Thread Alexis King
Imagine I have the following signature: (define-signature collector^ [(contracted [item/c contract?] [collect (-> item/c ... item/c)])]) Writing a unit that exports this signature is easy. For example, here’s one that sums its arguments: (define-unit

Re: [racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Jordan Johnson
> On Oct 17, 2018, at 10:35, Matthias Felleisen wrote: >> (check-expect (+ 10 .25) 10.25) >> >> errors with check-expect’s message about not comparing inexact numbers, but >> in DrRacket+BSL the decimals are treated as exact numbers. >> >> What do I need to change in the checker, in

[racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Jordan Johnson
Hi all, In my last thread regarding the handin server, Matthew suggested: > A workaround is to use `'lang/htdp-beginner` as the language instead of > `'(special beginner)`. That happens to avoid a redundant and > troublemaking `require`. So, I’m using 'lang/htdp-beginner in an assignment’s

Re: [racket-users] Higher-order units

2018-10-17 Thread Philip McGrath
The way I have found to do this is to both use the `tag` form and explicitly rename all signature elements, e.g.: (define-unit twice-collector@ (import (tag base (prefix base: collector^))) (export collector^) (define item/c base:item/c) (define (collect . xs) (apply base:collect

Re: [racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Matthias Felleisen
> On Oct 17, 2018, at 1:21 PM, Jordan Johnson wrote: > > Hi all, > > In my last thread regarding the handin server, Matthew suggested: >> A workaround is to use `'lang/htdp-beginner` as the language instead of >> `'(special beginner)`. That happens to avoid a redundant and >> troublemaking

Re: [racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Jordan Johnson
>> So, what aspect of the language config would be responsible for 41/4 not >> equaling 10.25? > > Welcome to Racket v7.0.0.20. >> (= 41/4 10.25) > #t >> (read-decimal-as-inexact #f) >> (= 41/4 10.25) > #t > > Do you perhaps print and read the result? Nope. The code that’s generating the

Re: [racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Matthias Felleisen
> On Oct 17, 2018, at 2:11 PM, Jordan Johnson wrote: > > >> On Oct 17, 2018, at 10:35, Matthias Felleisen wrote: >>> (check-expect (+ 10 .25) 10.25) >>> >>> errors with check-expect’s message about not comparing inexact numbers, but >>> in DrRacket+BSL the decimals are treated as exact

Re: [racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Shu-Hung You
On Wed, Oct 17, 2018 at 1:12 PM Jordan Johnson wrote: > > > On Oct 17, 2018, at 10:35, Matthias Felleisen wrote: > > (check-expect (+ 10 .25) 10.25) > > errors with check-expect’s message about not comparing inexact numbers, but > in DrRacket+BSL the decimals are treated as exact numbers. > >

Re: [racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Jordan Johnson
On Oct 17, 2018, at 11:30, Shu-Hung You wrote: > > Would it help if in the check module you use `=' as the equality test, > or specify #e10.25 instead? Success! Specifying (!test (hour-angle 12 20 30) #e10.25) produces the behavior I expected, correctly comparing the numbers. Thanks, all!

Re: [racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Jordan Johnson
> On Oct 17, 2018, at 11:30, Shu-Hung You > wrote: >> >> Would it help if in the check module you use `=' as the equality test, >> or specify #e10.25 instead? > > Success! > > Specifying > (!test (hour-angle 12 20 30) #e10.25) > produces the behavior

Re: [racket-users] Re: Let's organize a Scheme European Event at FOSDEM 2019

2018-10-17 Thread amz3
On Sunday, October 14, 2018 at 4:33:22 AM UTC+2, Claes Wallin (韋嘉誠) wrote: > > Looks like the > https://fosdem.org/2019/schedule/track/minimalistic_languages/ > devroom came through! > > Unfortunately, http://community.schemewiki.org/?FOSDEM2019 has been > down for days. Anyone know who is

Re: [racket-users] How to download image using net/http-client?

2018-10-17 Thread George Neuner
On 10/16/2018 4:02 PM, Philippe Mechaï wrote: Indeed the issue is with your call to pipe-content-length which is to be used with pipes and is not the Content-Length header returned when doing HTTP requests. The Content-Length can be found in the list of headers returned by the call to

Re: [racket-users] How to download image using net/http-client?

2018-10-17 Thread George Neuner
On 10/17/2018 9:06 AM, George Neuner wrote: But be aware that you may run into images that do *^NOT* have Content-Length  set.  Many sites assume images are only for display by the browser. Sorry.  Should have been  'do not' Gorge -- You received this message because you are subscribed to

Re: [racket-users] Web server hits "Sorry, this page has expired. Please go back."

2018-10-17 Thread Luke Whittlesey
Interesting conversation.. I want to add that #lang web-server does have file-boxes ( https://docs.racket-lang.org/web-server/stateless.html?q=web-server#%28part._lang%2Ffile-box%29) for when one might want to preserve data like you would in the store. To run across multiple machines I would