[racket-users] plotting graphs with flipped y axes

2020-05-03 Thread David Bremner

Does anyone know how to achieve plots like the attached with racket's
plot module? I'm stuck trying to invert the y axis. I'd like the smaller
y values to be at the top of the plot.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87368hgc30.fsf%40tethera.net.


wt8.pdf
Description: Adobe PDF document


[racket-users] using plai/gc2/{collector,mutator} in one file

2020-03-18 Thread David Bremner

As part of an effort to use plai/gc2 with the racket handin server
(never having really successfully used the multiple file stuff), I've
been trying (and failing) to use modules in one file for the collector
and mutator.

Attached is the simplest possible example I could cook up using sample
code from the web. In racket 7.6 I get a complaint about 'submod: not a
require sub-form ; in: (submod ".." null-gc)'. That doesn't seem right
to me, but I guess maybe allocator-setup was never tested with a
submodule path. Any workaround/correction is welcome.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87a74ddvyp.fsf%40tethera.net.


test.rkt
Description: Binary data


Re: [racket-users] typed-plai vs typed/racket

2020-03-11 Thread David Bremner
Pratyush Das  writes:

> Is there a comprehensive list of differences between typed-plai and 
> typed/racket?

I'm guessing you mean plai-typed. This is a simple type-inferred
language designed for teaching.  Because the language is simpler, the
type inference is in some sense better; it requires less hints. On the
other hand it lacks some features of typed/racket, like occurrence
typing and union types. If you search for those terms you can find
write-ups by members of the Racket team (or check
https://docs.racket-lang.org/ts-guide/index.html).

plai-typed (and plait, discussed below) also miss some of the "batteries
included" features of racket, like a rich set of looping constructs,
formatted output, and so on. I find students who know racket chafe a bit
at the minimalism of plai-typed / plait.

> Did typed-plai grow into typed/racket?

No, plai-typed actually arose later along with the second edition of the
book PLAI (see https://www.plai.org).

> Is there a way to use typed-plai in Racket 7.5? 

I would recommend looking at "plait", which is an actively maintained
successor to plai-typed, and works fine with Racket 7.5 (raco pkg
install plait).

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87y2s64hnx.fsf%40tethera.net.


[racket-users] Re: problem with :user-error-message in handin server

2020-01-08 Thread David Bremner
David Bremner  writes:
>
> (lambda (msg)
>   (add-header-line! "Erroneous submission!")
>   (add-header-line! (format "  --> ~a" msg))
>   (message (string-append
> "You have an error in your program -- please hit"
> " \"Run\" and debug your code.\n"
> "Email the course staff if you think your code is"
> " fine.\n"
> "(The submission has been saved but marked as"
> " erroneous.)")
>'(ok))
>   (message "Handin saved as erroneous." 'final))
>
> This cause the desired dialog box to pop up, but after I press OK I get
> a "Server Error" popup "while evaluating #: application: 
> not a procedure".
>
> I don't really understand where the identifier "evaluator-message" is
> defined, it shows up only in the .zo file for handin-server/checker.rkt.

I still don't understand what's going on, but it seems contrary to the
documentation, the return value from the procedure passed as
:user-error-message matters, and apparently it should be a procedure
taking one argument.

If I use the following

  :user-error-message (lambda (msg) (message msg '(ok))
  (lambda (thing) (message (format "~a" 
thing) '(ok

then I get two popups from the handin client. The first has the error
message, and the second just has #.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/874kx6gcie.fsf%40tethera.net.


[racket-users] problem with :user-error-message in handin server

2020-01-07 Thread David Bremner

Apologies if this appears twice. I sent the first one before being
subscribed, so suspect it might just have been black-holed by google.

I'm using the latest handin package for the handin server source,
installed with "raco pkg install handin". The server is running racket
7.2.

I'm trying to make the handin server accept erroneous submissions but
add a header line, following the example from the handin server
documentation I pass the following as :user-error-message

(lambda (msg)
  (add-header-line! "Erroneous submission!")
  (add-header-line! (format "  --> ~a" msg))
  (message (string-append
"You have an error in your program -- please hit"
" \"Run\" and debug your code.\n"
"Email the course staff if you think your code is"
" fine.\n"
"(The submission has been saved but marked as"
" erroneous.)")
   '(ok))
  (message "Handin saved as erroneous." 'final))

This cause the desired dialog box to pop up, but after I press OK I get
a "Server Error" popup "while evaluating #: application: not 
a procedure".

I don't really understand where the identifier "evaluator-message" is
defined, it shows up only in the .zo file for handin-server/checker.rkt.

In case it helps I attach the checker.rkt for the assignment in
question.

I'm triggering the error with a (/ 1 0) in the submission, but the type
of error does not seem to matter.

On a related topic, assuming I can get that to work, I'd like to do
something similar for !test. What's the easiest way to do that? Do I
need to use @test from the grading utilities? I basically just need to
call add-header-line! on test failure.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87eewbgeyp.fsf%40tethera.net.


checker.rkt
Description: Binary data