arclanguage / anarki

Community-managed fork of the Arc dialect of Lisp; for commit privileges submit a pull request.
http://arclanguage.github.io
Other
1.17k stars 160 forks source link

`ac.rkt`: handle `trash-whitespace` errors – fixes #60 + #199 #228

Closed montyanderson closed 6 months ago

montyanderson commented 6 months ago

Firstly, thanks to everyone maintaining this fork of Arc – I've been using it to run a music aggregator and it's awesome.

However, I noticed that even a single request may saturate the CPU for multiple seconds, while filling the console with the following errors.

char-whitespace?: contract violation
   expected: char?
   given: #<eof>
   context...:
    /opt/textural/ac.rkt:1448:0: trash-whitespace
    /opt/textural/ac.rkt:1463:4

Refactoring the trash-whitespace function to handle the contract errors killed both birds with one stone!

akkartik commented 6 months ago

Thank you!