Skip to content

Commit

Permalink
Add init.janet so a user can do (use spork)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpakin committed Jan 9, 2021
1 parent 248dadd commit c4d67dd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
site/
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Spork

Various Janet utility modules.
Various Janet utility modules. Spork aims to be grab bag of useful Janet functionality that
does not belong in the core library.


## Formatting
Expand Down Expand Up @@ -104,3 +105,5 @@ Remove indentation after concatenating the arguments.
hoho
hohoho
```))))) => "ho\n hoho\n hohoho"
9 changes: 7 additions & 2 deletions doc/index.mdz
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
:order 0}
---

Spork is a utility library for Janet. It contains a number of small modules
that should be useful for general programming in Janet but do not "make the cut"
for inclusion in the standard library. You can think of spork as a sort of extended standard
library for Janet.

## Source code

@p{@link[https://github.com/janet-lang/spork]}
Expand All @@ -17,8 +22,8 @@

## Index

@api-index[spork/fmt]
@api-index[../spork]

## Reference

@api-docs[spork/fmt]
@api-docs[../spork]
10 changes: 10 additions & 0 deletions spork/init.janet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# make (use spork) useful

(import ./argparse :export true)
(import ./fmt :export true)
(import ./misc :export true)
(import ./msg :export true)
(import ./netrepl :export true)
(import ./path :export true)
(import ./regex :export true)
(import ./rpc :export true)
6 changes: 6 additions & 0 deletions spork/msg.janet
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@
(buffer/push-string buf x)
(:write stream buf)
nil))

(defn make-proto
"Create both a send an recv function from a stream, as with
`make-send` and `make-recv`."
[stream &opt pack unpack]
[(make-send stream pack) (make-recv stream unpack)])

0 comments on commit c4d67dd

Please sign in to comment.