> On Aug 13, 2020, at 1:05 PM, Jens Axel Søgaard <[email protected]> wrote: > > Den tor. 13. aug. 2020 kl. 21.55 skrev Kevin Forchione <[email protected] > <mailto:[email protected]>>: > Hi guys, > > In Bracket [1] used your idea to produce s-expression, if the first argument > of #%app isn't a function: > > ; In the BRACKET language an application of > ; a non-function evaluates to an expression. > (define-syntax (sym-app stx) > (syntax-case stx () > [(_ op arg ...) > (quasisyntax/loc stx > (let ([o op]) > (if (procedure? o) > #,(syntax/loc stx (#%app o arg ...)) > (if (holdable? o) > (cons o '(arg ...)) > (cons o (list arg ...))))))])) > > There is an additional wrinkle - if a function is "holdable" it "holds" > (postpones) the > evaluation of its arguments. This can simply we be removed, if you don't need > it. > > More details here: > > https://github.com/soegaard/bracket/blob/master/bracket/bracket.rkt#L80 > <https://github.com/soegaard/bracket/blob/master/bracket/bracket.rkt#L80> Thanks! With a little modification that does the trick!
Kevin -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/1358F277-7B1F-4C25-B791-96F70807F641%40gmail.com.

