Arc Forumnew | comments | leaders | submitlogin
Can't coerce #(tagged mac #) fn hackernews clone
2 points by massim 5108 days ago | 5 comments
Can't coerce #(tagged mac #<procedure: fnform>) fn

  === context ===
  /var/www/an/data/nov/ac.scm:1005:0: ar-coerce
   login-form
   zz
   g2086
   g2003
   handle-request-thread


2 points by zck 5107 days ago | link

Yes, macros aren't functions, unfortunately. Thinking of them as such is a rather leaky abstraction.[1] If you post the code that's breaking, we should be able to help you. Is it a stock hn install, or have you edited it? The stock install has worked every time I've tried it.

[1] For example, this code won't work: (apply obj (list "steve" "steve's value"))

-----

1 point by massim 5107 days ago | link

It stock hn install I already change httpd port to 8887 [ error talk me that 8080 buse]. Forum work, login form not

1005 stroke ac.scm

  (define (ar-coerce x type . args)
    (let ((x-type (ar-type x)))
      (if (eqv? type x-type) x
          (let* ((fail        (lambda () (err "Can't coerce " x type)))
                 (conversions (hash-table-get coercions type fail))
                 (converter   (hash-table-get conversions x-type fail)))
            (ar-apply converter (cons x args))))))

-----

2 points by akkartik 5107 days ago | link

That's where in the compiler the error is raised, but there's no fnform there. Based on the error message, can you show us the definition of login-form in your codebase? Have you made any changes to it?

Did you get it from http://github.com/nex3/arc?

-----

1 point by massim 5102 days ago | link

Anariki error!

-----

1 point by akkartik 5102 days ago | link

Try deleting the file dispatch.arc in your copy, and stop loading it in libs.arc. It defines fnform as well, which may be causing a conflict.

Let us know if that fixes it, and I'll update anarki.

-----