[plt-scheme] Describe Function

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Nov 10 09:31:35 EST 2009

On Tue, Nov 10, 2009 at 8:25 AM, Dave Herman <dherman at ccs.neu.edu> wrote:
>> What other first-class data object would be useful to include (parameters,
>> which get described as procedures now, modules, units, signatures,
>> processes, ...)?
>
> FWIW, I once tried to come up with a list of built-in PLT datatypes, which
> you can find here:
>
>    http://bit.ly/2MSZtM
>
> (It's about 7 or 8 months old and there are probably plenty of omissions.)

This probably doesn't help Doug, but here is another way to define the
function linked above:

#lang scheme
(define (variant x)
  (string->symbol
   (regexp-replace #rx"^struct:"
                   (symbol->string (vector-ref (struct->vector x) 0))
                   "")))

(variant (λ (x) x))
(variant 1)
(variant (let/cc k k))
(variant (let/ec k k))


Posted on the users mailing list.