In racket, we have defsubform
for subform, but defsubform
does not accept a form like bar
but only (bar ...)
Asked
Active
Viewed 43 times
1 Answers
2
Here's a (cleaned-up) implementation of defsubform
#lang racket
(require scribble/core
scribble/decode)
(define (into-blockquote s)
(make-nested-flow (make-style "leftindent" null)
(if (splice? s)
(decode-flow (splice-run s))
(list s))))
(define-syntax (defsubform stx)
(syntax-case stx ()
[(_ . rest) #'(into-blockquote (defform . rest))]))
This suggests that you can implement defsubidform
as follows:
(define-syntax (defsubidform stx)
(syntax-case stx ()
[(_ . rest) #'(into-blockquote (defidform . rest))]))

Sorawee Porncharoenwase
- 6,305
- 1
- 14
- 28
-
Do you think this is worth adding back into scribble? – 林子篆 Aug 26 '21 at 00:34