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.

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

(define_class class_name content1 ...)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.