[plt-scheme] procedure instrospection

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Sun Apr 19 14:52:14 EDT 2009

FWIW, I'd be a very interested client of well-designed introspection  
facilities for PLT Scheme. For language experimentations that would be  
very valuable, at least from my perspective. Macros already give a  
nice bit of extensibility, but I've hit the lack of introspection on  
lambdas a couple of times already.

Maybe if the PLT team does not want to directly support it in the  
core, adding necessary hooks (in the Open Implementation line of  
thought) would be feasible? This would avoid everyone that needs some  
facilities to implement completely ad-hoc solutions.

-- Éric

On Apr 18, 2009, at 14:17 , Eli Barzilay wrote:

> On Apr 18, Jose A. Ortega Ruiz wrote:
>> Eli Barzilay <eli at barzilay.org> writes:
>>> But the name for the "optional" in the above is `b'...  I've put
>>> "optional" in quotes since it doesn't have to be an optional
>>> argument, it can be anything, and can have behavior that is not
>>> related to the other cases in the `case-lambda' form (that's why I
>>> used different strings in the above).  The resulting arities can
>>> also be arbitrary, for example:
>>>  (case-lambda [(x) 1]
>>>               [(a b c) 2]
>>>               [(i j k l m) 3])
>>> has an arity list of (1 3 5), which cannot be described with such
>>> an `#:optional'.
>> OK, i see your point now. what about something like:
>> (foo [x] [a b c] [i j k l m])
>> or
>> (foo [(x) (a b c) (i j k l m)])
>> ?
>>> Here's another random example from the texpict collection:
>>>  (define inset/clip
>>>    (case-lambda
>>>     [(p l t r b) ...]
>>>     [(p h v) (inset/clip p h v h v)]
>>>     [(p a)   (inset/clip p a a a a)]))
>> one could even try to be smart and share common prefixes:
>> (insert/clip p [l t r b] [h v] [a])
>> does that make sense?
> [Yes -- but that's a presentation issue.  My point was that there are
> all of these additional considerations to make.]
> -- 
>          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli  
> Barzilay:
>                  http://www.barzilay.org/                 Maze is  
> Life!
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.