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.

Ehh, I spoke too soon. The analagous student test —
(check-expect (hour-angle 12 20 30) 10.25)
— fails when included in the handin submission.

My working hypothesis is that I just need to configure the handin server’s 
evaluator to have (read-decimal-as-inexact #f). I’m trying to work out how to 
do that from the (check: ...) form, and failing that, will manually create & 
configure the evaluator.

If you can tell me how to do that — or tell me if I’m wrong — I’d much 
appreciate the saved time. But I do expect it’s a problem I can solve on my own 
with enough time.

Thanks,
Jordan


-- 
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.
For more options, visit https://groups.google.com/d/optout.


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!

Best,
Jordan

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 error is

(check: :language 'lang/htdp-intermediate
...
(!test (hour-angle 12 20 30) 10.25)
...)

I’m looking into !test now; I don’t yet know how it does its comparison.

jmj

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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.
>
> What do I need to change in the checker, in order to obtain the same numeric 
> behavior as in DrRacket?
>
> Set read-decimal-as-inexact might solve the problem.
>
>
> Progress! But not completely solved. By adding
>
> (read-decimal-as-inexact #f)
>
> to the checker module, I now don’t get the check-expect error. Instead, I’m 
> seeing
>
> submit error: your code failed a test: (hour-angle 12 20 30) evaluated to 
> 41/4, expecting 10.25
>
>
> produced by the checker line
>
> (!test (hour-angle 12 20 30) 10.25)
>

Would it help if in the check module you use `=' as the equality test,
or specify #e10.25 instead?

> where hour-angle computes exactly.
>
> So, what aspect of the language config would be responsible for 41/4 not 
> equaling 10.25?
>
> Best,
> Jordan
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 numbers.
>>> 
>>> What do I need to change in the checker, in order to obtain the same 
>>> numeric behavior as in DrRacket?
>> Set read-decimal-as-inexact might solve the problem. 
> 
> Progress! But not completely solved. By adding 
> (read-decimal-as-inexact #f)
> to the checker module, I now don’t get the check-expect error. Instead, I’m 
> seeing
> submit error: your code failed a test: (hour-angle 12 20 30) evaluated to 
> 41/4, expecting 10.25
> 
> produced by the checker line
> (!test (hour-angle 12 20 30) 10.25)
> where hour-angle computes exactly.
> 
> So, what aspect of the language config would be responsible for 41/4 not 
> equaling 10.25?


Hmph: 
 
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? 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 order to obtain the same numeric 
>> behavior as in DrRacket?
> Set read-decimal-as-inexact might solve the problem. 

Progress! But not completely solved. By adding 
(read-decimal-as-inexact #f)
to the checker module, I now don’t get the check-expect error. Instead, I’m 
seeing
submit error: your code failed a test: (hour-angle 12 20 30) evaluated to 41/4, 
expecting 10.25

produced by the checker line
(!test (hour-angle 12 20 30) 10.25)
where hour-angle computes exactly.

So, what aspect of the language config would be responsible for 41/4 not 
equaling 10.25?

Best,
Jordan

-- 
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.
For more options, visit https://groups.google.com/d/optout.


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 `require`.
> 
> So, I’m using 'lang/htdp-beginner in an assignment’s checker.rkt file, and I 
> am seeing errors that appear to be the result of the handin server using a 
> different reader (or configuration thereof) than DrRacket does for BSL. 
> Specifically,
> 
>   (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 order to obtain the same numeric 
> behavior as in DrRacket?


Set read-decimal-as-inexact might solve the problem. 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[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 checker.rkt file, and I am 
seeing errors that appear to be the result of the handin server using a 
different reader (or configuration thereof) than DrRacket does for BSL. 
Specifically,

(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 order to obtain the same numeric 
behavior as in DrRacket?

Thanks,
Jordan

-- 
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.
For more options, visit https://groups.google.com/d/optout.