Cat’s hacks:

lib

A succinct method for sharing Arc libraries.

Synopsis

A call such as

(lib "http://catdancer.github.com/erp.arc")

does the following:

  1. If the library file has already been loaded into Arc, nothing happens. (Program A can include libraries B and C, and library B can include library C, without C getting loaded twice).
  2. If the library file is already present in the lib directory, and it has a “.arc” extension, it is loaded into Arc.
  3. If the library isn't in the lib directory yet, it is downloaded from the remote site, and then, if it also has a “.arc” extension, loaded into Arc.

(lib-new)

Prints out a list of URL's that have a new version available or have been overridden. (That is, it prints out those URL's for which the file in the lib directory is different than the file at the URL).

(lib-fetch url)

Unconditionally downloads the URL and stores it in the lib directory.

Rationale

In other languagues, sharing code is complicated: you have to package it up, and then publish your package, and users have to download and install it, and then load it their program...

Following Paul Graham’s “Succinctness is Power” hypothesis, I tried to imagine what could be the quickest possible way to share and use Arc code.

Prerequisites

Bugs

Have fixes? Send them to me on GitHub.

Get This Hack

Comment

Comment in the Arc Forum.

License

public domain