File: grind-patch.lisp

package info (click to toggle)
maxima-sage 5.45.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 113,788 kB
  • sloc: lisp: 440,833; fortran: 14,665; perl: 14,369; tcl: 10,997; sh: 4,475; makefile: 2,520; ansic: 447; python: 262; xml: 59; awk: 37; sed: 17
file content (18 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;; -*- mode: lisp -*-
;; Copyright Leo Butler (leo.butler@ndsu.edu) 2015
;; Released under the terms of GPLv3+
(in-package :maxima)

(defun slash (x)
  (do ((l (cdr x) (cdr l))) ((null l))
    ;; Following test is the same (except backslash is not included,
    ;; so backslash is preceded by backslash) as in SCAN-TOKEN (src/nparse.lisp).
    ;; Any wide-char should not be escaped
    (if (or (ascii-numberp (car l)) (alphabetp (car l)) (> (char-code (car l)) 128.))
	nil
	(progn (rplacd l (cons (car l) (cdr l)))
	       (rplaca l #\\) (setq l (cdr l)))))
  (if (or (alphabetp (car x)) (> (char-code (car x)) 128.)) x (cons #\\ x)))


; end of grind-patch.lisp