0

Hi guys,

I'm working in plt-scheme and am trying to do multiple ellipsis (...) in my scheme macro pattern. Basically it's a macro for defining/creating a class with fields and methods.

When I try to do this:

(define_class class_name (field1 value1) ... ((meth1 . args1) body1 ) ...  )

Scheme says this:
"misplaced ellipses in pattern (follows other ellipses) in: ..."

To fix it I put another parenthesis set like this:

(define_class class_name (field1 value1) ... (((meth1 . args1) body1 ) ...)  )

However now my pattern has changed, users will have to now give extra parenthesis around all the class methods they want.

How do I do this:

(define_class class_name (field1 value1) ... ((meth1 . args1) body1 ) ...  )

and keep both ellipsis without changing the pattern.

Help is very much appreciated as I've looked everywhere.

2
Contributors
1
Reply
4
Views
7 Years
Discussion Span
Last Post by tuffff
0

Afaik, the only way for that syntax would be using:

(define_class class_name content1 ...)

and then ckecking (pair? (car content)) to distinguish them.

Edited by tuffff: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.