Login
7 branches 0 tags
Benjamin Vincent Schulenburg Implemented `quote` in Nujel instead of C 8d2fc43 4 years ago 24 Commits
nujel / bin / lib / io.nuj
[def help]
[let []
	[def iter [λ [l]
		[cond [[nil? l] #t]
		      [#t [display [describe [car l]]] [newline] [iter [cdr l]]
		]]
	]]

	[set! help [λ [i]
		"Describe 10 functions at offset 1"
		[let [[off [* [int i] 10]]]
		[iter [map cat [symbol-table off 10]]]
		[display [cat "Help page " [int i] " of " [/ [symbol-count] 10]]] [newline] #t]
	]]
]

[def repl-prompt #nil]
[let [[repl-count -1]]
	[set! repl-prompt [λ [i]
		"Display the REPL prompt"
		[set! repl-count [++ repl-count]]
		[display [cat "[" repl-count "]" [ansi-fg 1] "λ" [ansi-fg 12] ">" [ansi-reset] " "]]
	]]
]

[def test-context "Nujel Standalone"]