Arc Forumnew | comments | leaders | submitlogin
How to use Racket keyword args in Arc?
3 points by hjek 123 days ago | 1 comment

Can anyone tell me why this works in Racket,

    (require net/smtp)
    (smtp-send-message "" "" ""  "hello" '("hello world") #:auth-passwd "secretpassword" #:auth-user "")
whereas this fails in Arc,

    ($ (require net/smtp))
    ($ (smtp-send-message "" "" ""  "hello" '("hello world") #:auth-passwd "secretpassword" #:auth-user ""))
with this error,

    smtp-send-message: arity mismatch
    expected: a different number plus optional arguments with keywords #:auth-passwd, #:auth-user, #:port-no, #:tcp-connect, and #:tls-encode
    given: 9
Or why `keyword-apply` is bound in Racket but `$.keyword-apply` isn't in Arc?

It should be possible to use Racket keyword args from Arc; at least according to this,

3 points by hjek 123 days ago | link

I figured it out. Arc uses `lambda` from Mzscheme, and that version of `lambda` doesn't support keyword args. Trying to import Racket's `lambda` caused a conflict with the other `lambda`, so in the end I imported Racket's `keyword-apply` to do the job.

I have committed this code to the Anarki repo, so now everyone can use Racket keywords in their Arc programs. Yay!