Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brudgers/clojure-data-in


https://github.com/brudgers/clojure-data-in

Last synced: 6 days ago
JSON representation

Awesome Lists containing this project

README

        

# Introduction to data-in
The purpose of `data-in` is to read all the lines from a text file and return the file's contents as a Clojure value in a standardized manner.

# Specification
###Takes:
+ `Filename`

###Assumes:
+ a space delimited text file

###Returns:
+ Vector **[L1,L2,...Ln]** where **Li**:
+ represents a line in `Filename`
+ is a vector
+ contains EDN values

# Example:
If `my-file.txt` contains:

3 9
5 4
6 5
3 2

then `(data-in "./my-file.txt")` returns:

`[[3 9] [5 4] [6 5] [3 2]]`

# Comments
To avoid executing arbitrary code, `data-in` reads values from files with `clojure.edn/read-string`.

The input is not read lazily.