+(port-count-lines-enabled #t)
Show the line number in some error messages
When I try to run my application with this patch applied to Arc in MzScheme version 352, MzScheme crashes with “Process scheme segmentation fault”. I don’t know if this problem may have been fixed in some later version of MzScheme.
This patch turns on MzScheme’s port line counting feature. This means that some Arc errors will now display the line number of the error.
buggy.arc:1: (def a (x) 2: (+ 3 x)) 3: 4: (def b (y) <-- parenthesis at beginning of line not closed 5: (* y 4) 6: 7: (def c (z) 8: (/ (b z) 4))
Before:
arc> (load "buggy.arc") Error: "buggy.arc::23: read: expected a ')'"
After:
arc> (load "buggy.arc") Error: "buggy.arc:4:0: read: expected a ')'"
By using git or patch, you can incorporate this patch into your version of Arc.
$ git pull git://github.com/CatDancer/arc.git tag arc2.port-line-counting0
For example,
$ mkdir arc $ cd arc $ git init $ git pull git://github.com/CatDancer/arc.git tag arc2.port-line-counting0
To apply this patch to your copy of arc using the patch command, download arc2.port-line-counting0.patch into your Arc directory, and at the Unix command line inside the Arc directory, type:
patch <arc2.port-line-counting0.patch
“patch
” is a standard utility that comes with Unix. (If you’re running Windows, iirc patch
comes with cygwin).
For example,
$ wget http://ycombinator.com/arc/arc2.tar [... downloading ...] $ tar xf arc2.tar $ cd arc2 $ patch <arc2.port-line-counting0.patch patching [...] $
The original Arc source is copyrighted by Paul Graham and Robert Morris and licensed under the Perl Foundations's Artistic License 2.0 as described in the “copyright” file in the Arc distribution.
My changes to Arc (this patch that I wrote) are in the public domain.
The combination of the original Arc and my changes together (what you get after you apply my patch) is also licensed under the Perl Foundations's Artistic License 2.0.