1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 14:47:47 +00:00

Merge pull request #63 from nushell/lisp_mode

Add a lisp mode
This commit is contained in:
JT 2021-06-10 07:09:55 +12:00 committed by GitHub
commit 5203c267e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

35
fun/lisp_mode.nu Normal file
View file

@ -0,0 +1,35 @@
# Note: this requires the latest 0.32.1 or later
#
# usage:
# > source lisp_mode.nu
# > (echo (+ 1 (* 3 2)))
def + [x, y] { $x + $y }
def - [x, y] { $x - $y }
def * [x, y] { $x * $y }
def / [x, y] { $x / $y }
def in [x, y] { $x in $y }
def not-in [x, y] { $x not-in $y}
def < [x, y] { $x < $y }
def <= [x, y] { $x <= $y }
def > [x, y] { $x > $y }
def >= [x, y] { $x >= $y }
def == [x, y] { $x == $y }
def != [x, y] { $x != $y }
def =~ [x, y] { $x =~ $y }
def !~ [x, y] { $x !~ $y }
def array [...rest] { echo $rest }