PasteRack.org
Paste # 50461
2017-08-09 13:01:06

Fork as a new paste.

Paste viewed 23 times.


Embed:

for/set macro broken?

#lang typed/racket

(require racket/set)

;; Simple case.  Can't get to work.
(: test (Setof Integer) -> (Setof Integer))
(define (test ss)
  (let ([ss1 (for/seteq ([s ss]))))
    ss1))

;; Ultimate goal
(: set-filter (All (a) (Setof a) (a -> Boolean) -> (Setof a)))
(define (set-filter ss f)
  (let ([ss1 (for/seteq ([s ss] #:when (f s)) s)])
    (set-subtact ss ss1)))

=>

prog:8:33: read: missing `]' to close preceding `[', found instead `)'
  context...:
   /home/pasterack/racket68/collects/syntax/module-reader.rkt:186:17: body
   /home/pasterack/racket68/collects/syntax/module-reader.rkt:183:2: wrap-internal
   lang:read-syntax
   /home/pasterack/racket68/share/pkgs/scribble-lib/scribble/private/manual-code.rkt:112:0: get-tokens
   /home/pasterack/racket68/share/pkgs/scribble-lib/scribble/private/manual-code.rkt:56:0: typeset-code15
   /home/pasterack/pasterack/tmp/50461/50461code.scrbl: [running body]
   loop
   ...cket/cmdline.rkt:179:51
   /home/pasterack/racket68/share/pkgs/scribble-lib/scribble/run.rkt: [running body]