Tabs versus Spaces in Source Code

Pascal Bourguignon pjb at informatimago.com
Thu May 18 07:10:13 EDT 2006


Edmond Dantes <edmond at le-comte-de-monte-cristo.biz> writes:
> It all depends on your editor of choice. Emacs editing of Lisp (and a few
> other languages, such as Python) makes the issue more or less moot. I
> personally would recommend choosing one editor to use with all your
> projects, and Emacs is wonderful in that it has been ported to just about
> every platform imaginable. 
>
> The real issue is, of course, that ASCII is showing its age and we should
> probably supplant it with something better. But I know that will never fly,
> given the torrents of code, configuration files, and everything else in
> ASCII. Even Unicode couldn't put a dent in it, despite the obvious growing
> global development efforts. Not sure how many compilers would be able to
> handle Unicode source anyway. I suspect the large majority of them would
> would choke big time.

All right unicode support is not 100% perfect already, but my main
compilers support it perfectly well, only 1/5 don't support it, and
1/5 support it partially:

------(unicode-script.lisp)---------------------------------------------

(defun clisp (file)
  (ext:run-program "/usr/local/bin/clisp"
    :arguments (list "-ansi" "-norc"  "-on-error" "exit"
                     "-E" "utf-8"
                     "-i" file "-x" "(ext:quit)")
    :input nil :output :terminal :wait t))

(defun gcl (file)
  (ext:run-program "/usr/local/bin/gcl"
    :arguments (list "-batch"
                     "-load" file "-eval" "(lisp:quit)")
    :input nil :output :terminal :wait t))

(defun ecl (file)
  (ext:run-program "/usr/local/bin/ecl"
    :arguments (list "-norc"
                     "-load" file "-eval" "(si:quit)")
    :input nil :output :terminal :wait t))

(defun sbcl (file)
  (ext:run-program "/usr/local/bin/sbcl"
    :arguments (list "--userinit" "/dev/null"
                     "--load" file "--eval" "(sb-ext:quit)")
    :input nil :output :terminal :wait t))

(defun cmucl (file)
  (ext:run-program "/usr/local/bin/cmucl"
    :arguments (list "-noinit"
                     "-load" file "-eval"  "(extensions:quit)")
    :input nil :output :terminal :wait t))


(dolist (implementation '(clisp gcl ecl  sbcl cmucl))
  (sleep 3)
  (terpri) (print implementation) (terpri)
  (funcall implementation "unicode-source.lisp"))

------(unicode-source.lisp)---------------------------------------------
;; -*- coding: utf-8 -*-

(eval-when (:compile-toplevel :load-toplevel :execute)
  (format t "~2%~A ~A~2%"
          (lisp-implementation-type)
          (lisp-implementation-version))
  (finish-output))


(defun ιοτα (&key (номер 10) (단계 1) (בכוכ 0))
  (loop :for i :from בכוכ :to номер :by 단계 :collect i))


(defun test ()
  (format t "~%Calling ~S --> ~A~%"
          '(ιοτα :номер 10 :단계 2  :בכוכ 2)
          (ιοτα :номер 10 :단계 2  :בכוכ 2)))

(test)

------------------------------------------------------------------------

(load"unicode-script.lisp")
;; Loading file unicode-script.lisp ...

CLISP 
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2006

;; Loading file unicode-source.lisp ...

CLISP 2.38 (2006-01-24) (built 3347193361) (memory 3347193794)


Calling (ΙΟΤΑ :НОМЕР 10 :단계 2 :בכוכ 2) --> (2 4 6 8 10)
;; Loaded file unicode-source.lisp
Bye.


GCL 


GNU Common Lisp (GCL) GCL 2.6.7


Calling (ιοτα :номер 10 :단계 2 :בכוכ 2) --> (2 4 6 8
                                                             10)


ECL 
;;; Loading "unicode-source.lisp"


ECL 0.9g


Calling (ιοτα :номер 10 :단계 2 :בכוכ 2) --> (2 4 6 8 10)


SBCL 
This is SBCL 0.9.12, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.


SBCL 0.9.12


Calling (|ιοτα| :|номер| 10 :|ˋ¨ʳ„| 2 :|בכוכ| 2) --> (2 4 6 8 10)


CMUCL 
; Loading #P"/local/users/pjb/src/lisp/encours/unicode-source.lisp".


CMU Common Lisp 19c (19C)


Reader error at 214 on #<Stream for file "/local/users/pjb/src/lisp/encours/unicode-source.lisp">:
Undefined read-macro character #\ÃŽ
   [Condition of type READER-ERROR]

Restarts:
  0: [CONTINUE] Return NIL from load of "unicode-source.lisp".
  1: [ABORT   ] Skip remaining initializations.

Debug  (type H for help)

(LISP::%READER-ERROR
 #<Stream for file "/local/users/pjb/src/lisp/encours/unicode-source.lisp">
 "Undefined read-macro character ~S"
 #\ÃŽ)
Source: Error finding source: 
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer exists:
  target:code/reader.lisp.
0] abort
* 
Received EOF on *standard-input*, switching to *terminal-io*.
* (extensions:quit)
;; Loaded file unicode-script.lisp
T
[4]> 


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Grace personified,
I leap into the window.
I meant to do that.



More information about the Python-list mailing list