Arc Forumnew | comments | leaders | submitlogin
4 points by Oscar-Belletti 3118 days ago | link | parent

I think I found the problem. Diskvar is broken:

  (mac fromdisk (var file init load save)
    (w/uniq (gf gv)
      `(unless (bound ',var)
         (do1 (= ,var (iflet ,gf (file-exists ,file)
                                 (,load ,gf)
                                 ,init))
              (= (savers* ',var) (fn (,gv) (,save ,gv ,file)))))))
Notice the "(iflet ,gf (file-exists ,file)". It expexts file-exists to return the name of the file if it exists. file-exists doesn't, it returns t if files exists, so here is the cause of "error: open-input-file: contract violation expected: path-string? given: 't ".


4 points by Pauan 3115 days ago | link

Hey, I'm the author of Arc/Nu.

Thanks for letting me know about this.

In my opinion, returning t/nil makes more sense than returning the file path, but Arc/Nu is supposed to be backwards compatible with Arc 3.1, so I fixed this. I also fixed "dir-exists", which has the same issue.

I just pushed out the fix to the Arc/Nu GitHub repository, please try it out and let me know if it solves the problem for you.

-----

4 points by Oscar-Belletti 3113 days ago | link

I've just tried running the news site with the new version of Arc/Nu and it runs fine.

-----

3 points by Pauan 3112 days ago | link

Thanks for letting me know, I'm glad it's working now.

-----

2 points by akkartik 3118 days ago | link

You're right. It looks like file-exists has changed its behavior in Arc-Nu to return a boolean even though its being loaded from lang/arc/3.1/main, which might lead one to think it's trying to be compatible with Arc 3.1 [1]. Let me try to reach out to the original author.

[1] Arc has always returned the name on success, as far back as the Arc 0 release.

-----

1 point by akkartik 3118 days ago | link

What platform are you on? I'm reminded of this other bug with diskvar on Windows (since fixed on Anarki): http://arclanguage.org/item?id=19310

I haven't tried Arc/Nu, but Arc 3.1 and Anarki both return a string path name on success.

-----

3 points by Oscar-Belletti 3118 days ago | link

I am using racket v5.3.6 on Xubuntu.

-----