[plt-scheme] Match expression with underscore

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sat Apr 14 08:36:35 EDT 2007

Hi all,

In match an underscore matches anything. But how
do I match an underscore?


   Welcome to DrScheme, version 369.8-svn17feb2007 [3m].
   Language: Pretty Big (includes MrEd and Advanced Student).

   > (match '_
       [('_) 2])
   match: no matching clause for _

Is it a bug, or is it intentional?


For now I am using this workaround:

   > (define (underscore? o)
       (eq? o '_))
   > (match '_
       [(? underscore? s) s])
   _

-- 
Jens Axel Søgaard



Posted on the users mailing list.