Arc Forumnew | comments | leaders | submitlogin
Accessing Racket from anarki
3 points by jsgrahamus 3013 days ago | 9 comments
So this works:

  arc> ($:pair? '(1))
  #t
But this does not (verified in plain Racket):

  arc> ($:first '(1 2))
  first: undefined;
 cannot reference an identifier before its definition
    in module: "/home/steve/anarki/ac.scm"
    context...:
     /home/steve/anarki/ac.scm:1262:4

  arc> 

How come?

Steve



4 points by akkartik 3012 days ago | link

Just to summarize rocketnia's and Oscar-Belletti's investigations on this thread, do this:

  arc> ($:require racket/list)
  arc> ($:first '(1 2))
  1

-----

3 points by akkartik 3013 days ago | link

My guess is that it's because even though Arc uses Racket, it's still using its legacy MzScheme language. This works, though:

  arc> ($:car '(1 2))
  1
Though I'm not sure where we can find MzScheme-specific documentation anymore..

-----

4 points by Oscar-Belletti 3012 days ago | link

I think you are right: the file ac.scm starts with:

    (module ac mzscheme
MzScheme doesn't have first.

On the wayback machine I found the docs of 2008 for MzScheme version 372: http://web.archive.org/web/20080511203435/http://www.plt-sch...

There are still MzScheme docs here: http://www.plt-scheme.org/software/mzscheme/docs.html but the links on that page don't work for me, so I found the page on the wayback machine(2009) too: http://web.archive.org/web/20090603011739/http://www.plt-sch...

-----

4 points by rocketnia 3012 days ago | link

There should be up-to-date reference information about the mzscheme library here: https://docs.racket-lang.org/mzscheme/index.html?q=mzscheme

As described there, mzscheme exports most of the bindings of racket/base. As described at https://docs.racket-lang.org/reference/pairs.html?q=first#%2..., first is exported by racket/list and racket, but not by racket/base.

(My point isn't to say "you should have known" but to point out what the current documentation is like in case it's helpful for other reasons. XD )

-----

2 points by Oscar-Belletti 3012 days ago | link

You are right. Sorry for the outdated links.

-----

1 point by rocketnia 3012 days ago | link

Er, I upvoted your "sorry" just now because I did find it interesting that those archive links exist. :) I guess the Racket project doesn't have such tireless devotion to documentation that they maintain active versions of the docs for old software releases, but it's nice that a snapshot is up somewhere.

-----

2 points by akkartik 3012 days ago | link

Nice work!

-----

1 point by Oscar-Belletti 3012 days ago | link

Thanks!

-----

4 points by jsgrahamus 3011 days ago | link

Thanks, guys. This is great!`

-----