Expose the mk-rhs function normalize-definition uses. #508

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

deeglaze commented Dec 4, 2013

I found I wanted this to make a define/stub macro that errors giving the defined identifier:

(define-syntax (define/stub stx)
  (syntax-case stx ()
    [(_ header)
     (let-values ([(id mk-rhs body) (normalize-definition/mk-rhs stx #'lambda #t #t #f)])
       #`(define #,id #,(mk-rhs #`(error '#,id "TODO: stub"))))]))
J. Ian Johnson Expose the mk-rhs function normalize-definition uses.
I found I wanted this to make a define/stub macro that errors giving the defined identifier:

(define-syntax (define/stub stx)
  (syntax-case stx ()
    [(_ header)
     (let-values ([(id mk-rhs body) (normalize-definition/mk-rhs stx #'lambda #t #t #f)])
       #`(define #,id #,(mk-rhs #`(error '#,id "TODO: stub"))))]))
54280cb
Owner

samth commented Mar 31, 2014

This seems to have its documentation in an old doc.txt file. The real documentation is in the racket-doc pkg, under syntax/scribblings/transformer-helpers.scrbl.

Contributor

deeglaze commented Mar 31, 2014

Fixed.

Owner

samth commented Mar 31, 2014

@mflatt Thoughts on this?

Owner

samth commented Jun 24, 2014

@mflatt ping

Owner

mflatt commented Jun 26, 2014

Sorry that I kept overlooking this patch. It looks ok to me, though a couple of minor style details could be fixed in the docs: capital "T" to start the prose, and change "this" used as a noun in the last sentence to "The err-no-body? argument".

Meanwhile, I've put "clean up lingering doc.txt files" on my todo list.

J. Ian Johnson Doc fixup d9703b2
Contributor

deeglaze commented Jul 18, 2014

@mflatt Doc fixup done.

samth closed this in af12f85 Mar 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment