Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexknauth/syntax-sloc
counts the number of source lines of code in a racket syntax object
https://github.com/alexknauth/syntax-sloc
Last synced: about 1 month ago
JSON representation
counts the number of source lines of code in a racket syntax object
- Host: GitHub
- URL: https://github.com/alexknauth/syntax-sloc
- Owner: AlexKnauth
- License: mit
- Created: 2016-05-02T22:12:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-08T17:06:01.000Z (almost 3 years ago)
- Last Synced: 2024-10-16T02:55:19.923Z (3 months ago)
- Language: Racket
- Size: 33.2 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
syntax-sloc [![Build Status](https://travis-ci.org/AlexKnauth/syntax-sloc.png?branch=master)](https://travis-ci.org/AlexKnauth/syntax-sloc)
===
A racket package that counts the number of source lines of code in a racket syntax object.documentation: http://docs.racket-lang.org/syntax-sloc/index.html
```racket
> (require syntax-sloc); counting source lines of code in a syntax object:
> (syntax-sloc #'(define (distance x1 y1 x2 y2)
; the distance between the two points is the length
; of the hypotenuse, which is sqrt[(Δx)^2 + (Δy)^2]
(sqrt (+ (* (- x2 x1) (- x2 x1))
(* (- y2 y1) (- y2 y1))))))
3; or counting them in a #lang file:
> (current-directory (path-only (collection-file-path "lang-file-sloc.rkt" "syntax-sloc")))
> (lang-file-sloc "lang-file-sloc.rkt")
14
```On the command line, `raco sloc [] ...` prints line counts
for its arguments.```
$ raco sloc lang-file-sloc.rkt
SLOC Source
14 lang-file-sloc.rkt
```