Collection of Nim procs/templates/macros which can serve as “phew! I am glad Nim has this!” for Emacs/Emacs-Lisp/Lisp enthusiasts.
https://kaushalmodi.github.io/elnim/
(car LIST)
Return the car of LIST. If arg is nil, return nil. Error if arg is not nil and not a cons cell. See also ‘car-safe’.
See Info node ‘(elisp)Cons Cells’ for a discussion of related basic Lisp concepts such as car, cdr, cons cell and list.
(cdr LIST)
Return the cdr of LIST. If arg is nil, return nil. Error if arg is not nil and not a cons cell. See also ‘cdr-safe’.
See Info node ‘(elisp)Cons Cells’ for a discussion of related basic Lisp concepts such as car, cdr, cons cell and list.
(assoc KEY LIST &optional TESTFN)
Return non-nil if KEY is equal to the car of an element of LIST. The value is actually the first element of LIST whose car equals KEY.
Equality is defined by TESTFN if non-nil or by ‘equal’ if nil.
(delete ELT SEQ)
Delete members of SEQ which are ‘equal’ to ELT, and return the result. SEQ must be a sequence (i.e. a list, a vector, or a string). The return value is a sequence of the same type.
(mapconcat FUNCTION SEQUENCE SEPARATOR)
Apply FUNCTION to each element of SEQUENCE, and concat the results as strings. In between each pair of results, stick in SEPARATOR. Thus, ” ” as SEPARATOR results in spaces between the values returned by FUNCTION. SEQUENCE may be a list, a vector, a bool-vector, or a string.
(member ELT LIST)
For more information check the manuals.
Return non-nil if ELT is an element of LIST. Comparison done with ‘equal’. The value is actually the tail of LIST whose car is ELT.
(if-let* VARLIST THEN &rest ELSE)
Bind variables according to VARLIST and eval THEN or ELSE. Each binding is evaluated in turn, and evaluation stops if a binding value is nil. If all are non-nil, the value of THEN is returned, or the last form in ELSE is returned.
Each element of VARLIST is a list (SYMBOL VALUEFORM) which binds SYMBOL to the value of VALUEFORM. An element can additionally be of the form (VALUEFORM), which is evaluated and checked for nil; i.e. SYMBOL can be omitted if only the test result is of interest.
Needs Nim built from its devel
branch (<2018-10-16 Tue>).
Do this step first, before you execute any of the below “nim” commands:
# cd to the repo root git clone https://github.com/kaushalmodi/nim_config && cp nim_config/config.nims .
nim test
Create the HTML page and associated search index in <repo>/public/
.
nim docs