[PL-sem-jr] Next week: Plotkin

Benjamin Greenman types at ccs.neu.edu
Tue Dec 8 20:41:19 EST 2015


Reminder: tomorrow at 4:30pm in 164 we'll talk about ISWIM & the λ calculus.

On Wed, Dec 2, 2015 at 6:07 PM, Benjamin Greenman <types at ccs.neu.edu> wrote:

> Next week at PL Junior, we'll look at Plotkin's "Call By Name, Call By
> Value, and the Lambda Calculus".
>
> http://homepages.inf.ed.ac.uk/gdp/publications/cbn_cbv_lambda.pdf
>
> Until then, here's my KWIK system.
>
> #lang racket
>
> ;; Usage: racket kwik.rkt FILE.txt
>
> (module+ main
>   (define (rotate* x*)
>     (for/fold ([acc '()])
>               ([_i (in-list x*)])
>       (if (null? acc) (cons x* acc) (cons (append (cdar acc) (list (caar
> acc))) acc))))
>   (with-input-from-file (vector-ref (current-command-line-arguments) 0)
>     (lambda ()
>       (for ([ln (in-list (sort (apply append (for/list ([ln (in-lines)])
> (rotate* (string-split ln " ")))) string<? #:key car))])
>         (displayln (string-join ln " "))))))
>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the Pl-sem-jr mailing list