[racket] macro question

From: Kevin Forchione (lysseus at gmail.com)
Date: Thu Oct 2 21:19:14 EDT 2014

Hi guys,
Why does this appear to work? I assume it’s not a recommended approach. 

#lang racket

(require (for-syntax syntax/parse))

(define-syntax (mylet stx)
  (let ([val (syntax-case stx ()
               [(_ x) #'x]
               [(_ x xs ...) #'(cons x (mylet xs ...))])])
    val))

(mylet 1 2 3) => ‘(1 2 3)

-Kevin

Posted on the users mailing list.