File: grind-patch.lisp

package info (click to toggle)
maxima 5.47.0-9
  • links: PTS
  • area: main
  • in suites: forky
  • size: 193,104 kB
  • sloc: lisp: 434,678; fortran: 14,665; tcl: 10,990; sh: 4,577; makefile: 2,763; ansic: 447; java: 328; python: 262; perl: 201; xml: 60; awk: 28; sed: 15; javascript: 2
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