From: eric dahlman
Subject: Does MS Word use lisp???
Date: 
Message-ID: <tz47lwvcyyf.fsf@bbking.cs.colostate.edu>
Hi all, 

I know that this is not really on topic but I just found something
that really confuses me.  I got an attached Word document in some
email today and since I didn't want to go all the way up stairs to
find a PC I just ran strings on the the thing to see if I could get
the test out in a readable form.  The document was in Finnish and
apparently strings doesn't know how to recognize that sort of stuff,
but way came out was really interesting.  I have appended it to this
post.

It certainly looks like some lisp code is embedded into file.  Or is
this just some junk that got included some other way.  I know some of
the file saving techniques used by MS Word are kind of sketchy when it
comes to saving unzeroed newly allocated memory.  So what have I
found?

Finally, I don't know if this is a good thing or not.  It would be
really cool to list Word as a Lisp application, you couldn't get more
mainstream than that.  However, it does make it hard to argue that
Lisp is fast ;-).

-Eric "I still use (X)Emacs..." Dahlman


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

<snipped to protect the innocent>

tions (LAYERS), (LTYPES), (VIEWS), (STYLES), and (BLOCKS)
;  can be called independently.  Each lists the entries in the
;  associated symbol table, optionally in alphabetical order.  The
;  TABLES command ((C:TABLES) funciton) calls each of them in turn.
;  For the layer, lin

<snipped to protect the innocent>

Microsoft Word for Windows 95
Heippa taas
(strcat
            (if (= lt cl) f "  ")       ; flag current entity linetype
            (strfill lt 12)             ; edit layer name
            (strfill (chr a) 7)         ; alignment code
            (strfill (itoa s) 6)        ; number of dash length items
            (substr d 1 30)             ; linetype description
         )
      )
      (if (> s 0) (progn
         ;  Edit dash length items
         (setq x (member (assoc 49 x) x)) ; get list of dash items
         (while x
            (setq s (cdar x))           ; get dash length
            (write-line
               (strcat
                  (strfill " " 27)
                  (cond ((= s 0) "Dot")
                        ((> s 0) (strcat "Pen down " (rtos s 2 4)))
                        (T       (strcat "Pen up   " (rtos (abs s) 2 4)))
                  )
               )
            )
            (setq x (cdr x))            ; get next dash item
         )
      ))
      (setq x (next nil))               ; get next linetype entry
   )
   (princ (if (= n 0) "  -None-\n\n" "\n"))
   nil
;  (VIEWS) - Dump the named view table
(defun views ( / c d h n v w x z)
   (tblset "view")
   (write-line "  View        Height x Width    Center            Direction")
   (terpri)
   (setq n 0)
   (setq x (next T))                    ; get first view
   (while x
      (setq n  (1+ n)
            v  (fld  2 x)               ; view name
            c  (fld 10 x)               ; center point
            d  (fld 11 x)               ; X,Y of direction
            z  (fld 31 x)               ; Z of direction
            h  (fld 40 x)               ; height
            w  (fld 41 x)               ; width (valid only for windows)
      )
      (write-line
         (strcat
            "  "
            (strfill v 12)              ; edit view name
            (strfill (strcat (rtos h 2 4)   ; edit height x width
                             "x"
                             (rtos w 2 4)) 18
            )
            (strfill (strcat (rtos (car c) 2 4)  ; edit center point
                             ","
                             (rtos (cadr c) 2 4)) 18
            )
            (rtos (car d) 2 4)          ; edit X portion of direction
            ","
            (rtos (cadr d) 2 4)         ; edit Y portion of direction
            ","
            (rtos z 2 4)                ; edit Z portion of direction
         )
      )
      (setq x (next nil))               ; get next view entry
   )
   (princ (if (= n 0) "  -None-\n\n" "\n"))
   nil
;  (STYLES) - Dump the text style table
(defun styles ( / cs fb ff g h n o s w x)
   (tblset "style")
   (write-line "  Text style  Height  Width   Slant  Flags  Font      Bigfont")
   (terpri)
   (setq cs (getvar "textstyle"))       ; get current style
   (setq n  0)
   (setq x  (next T))                   ; get first style
   (while x
      (setq n  (1+ n)
            s  (fld  2 x)               ; style name
            ff (fld  3 x)               ; primary font file
            fb (fld  4 x)               ; big font file
            h  (fld 40 x)               ; height
            w  (fld 41 x)               ; width factor
            o  (fld 50 x)               ; obliquing angle
            g  (fld 71 x)               ; gener
Heippa taas

From: Steve Gonedes
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <m2n25rcx1y.fsf@KludgeUnix.com>
eric dahlman <·······@cs.colostate.edu> writes:
 
< Finally, I don't know if this is a good thing or not.  It would be
< really cool to list Word as a Lisp application, you couldn't get more
< mainstream than that.  However, it does make it hard to argue that
< Lisp is fast ;-).
< 
< -Eric "I still use (X)Emacs..." Dahlman
 
Look like the machine that saved the file was running emacs...
From: Donald Fisk
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <36507924.C52B9B86@bt-sys.spamblock.bt.co.uk>
eric dahlman wrote:

> I know that this is not really on topic but I just found something
> that really confuses me.  I got an attached Word document in some
> email today and since I didn't want to go all the way up stairs to
> find a PC I just ran strings on the the thing to see if I could get
> the test out in a readable form.  The document was in Finnish and
> apparently strings doesn't know how to recognize that sort of stuff,
> but way came out was really interesting.  I have appended it to this
> post.
>
> It certainly looks like some lisp code is embedded into file.  Or is
> this just some junk that got included some other way.  I know some of
> the file saving techniques used by MS Word are kind of sketchy when it
> comes to saving unzeroed newly allocated memory.  So what have I
> found?

MS Word files have bits of garbage from the last time Word was used.It looks like
that.   Someone has entered some Lisp into a Word document
and then used Word for another purpose, leaving around bits of Lisp in
the new file.   So I think we can rule out an unreleased version of
Microsoft Visual Lisp.

Potentially this is a security problem, as information could reach
a recipient other than the one it was intended for.

I notice that whoever wrote the Lisp in question has applied the
dubious practice of writing Lisp with lines containing only a single
close parenthesis.

I'd heard of some Microsoft application that used Prolog, though,
buried inside a .dll file.

--
Le Hibou (mo bheachd fh�in: my own opinion)
"it's just that in C++ and the like, you don't trust _anybody_,
and in CLOS you basically trust everybody.  the practical result
is that thieves and bums use C++ and nice people use CLOS."
 -- Erik Naggum
From: Harley Davis
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <72q364$4js$1@news1-alterdial.uu.net>
>I'd heard of some Microsoft application that used Prolog, though,
>buried inside a .dll file.


Yes, Windows NT uses a Prolog-like language with a Lispy syntax to do some
low-level configuration.  There is a way to see some of the configuration
code that I saw a few years ago but I can't seem to find it now.

-- Harley
From: Rainer Joswig
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <joswig-1611982235030001@pbg3.lavielle.com>
In article <············@news1-alterdial.uu.net>, "Harley Davis"
<··············@spamless_ilog.com> wrote:

> >I'd heard of some Microsoft application that used Prolog, though,
> >buried inside a .dll file.
> 
> 
> Yes, Windows NT uses a Prolog-like language with a Lispy syntax to do some
> low-level configuration.  There is a way to see some of the configuration
> code that I saw a few years ago but I can't seem to find it now.
> 
> -- Harley

maybe you guys like this mail from the Macintosh Common Lisp
mailing list years ago:

  > X-Sender: ·····@ministry.cambridge.apple.com
  > Mime-Version: 1.0
  > Date: Wed, 5 Jan 1994 18:09:10 -0500
  > To: ········@cambridge.apple.com
  > From: ·····@cambridge.apple.com (Steve Strassmann)
  > Subject: Microsoft ships MCL app to developers
  > X-Lines: 38
  > Status: RO
  > 
  > I just got the Microsoft MacOLE 2.0 cdrom (Beta2, for Developers). 
  > I'm not a big fan of OLE (OpenDoc is *so* much nicer, but hey, perhaps 
  > I'm just a tad biased), but it's always interesting to see who uses 
  > MCL out there, and for what.
  > 
  > The folder "UI Demo" on the CDROM contains a mockup called Microsoft 
  > Word 5.OLE. If it wasn't for ResEdit (or the readme file, see below), 
  > you couldn't tell it was written in MCL. 
  > 
  > It has a perfectly normal-looking MS Word look'n'feel (except for OLE), 
  > including plain Word icons in the Finder, menus, toolbar, etc., and of 
  > course, no Listener. Well, ok, so most of the menus and tools actually 
  > do nothing.
  > 
  > Here's the readme file:
  > 
  > --------
  > MacOLE 2.0 User Interface Demonstration Program
  > 
  > The MacOLE 2.0 User Interface Demonstration Program provides a visual
  > example of an implementation of OLE 2.0.  This program was written in
  > Common Lisp for the purposes of having a User Interface Mockup for OLE 2.0
  > on the Macintosh.  It does not use the MacOLE libraries and does not
  > reflect the speed or size of the OLE libraries or any applications using
  > OLE.
  > 
  > Any references to Companies or Products in the User Interface Prototype do
  > not reflect any definitive plans to use MacOLE 2.0 in future products on
  > the part of either Microsoft or any other Independent Software Vendor. 
  > These references are for demonstration purposes to provide a sense of
  > realism to the prototype.  
  > 
  > Have fun with the MacOLE 2.0 UI demonstration!

;-)

-- 
http://www.lavielle.com/~joswig
From: Ralf Muschall
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <72qagn$2t1$1@news02.btx.dtag.de>
Donald Fisk wrote:

> MS Word files have bits of garbage from the last time Word was 
>  used.It looks like
> that.   Someone has entered some Lisp into a Word document

Not necessary. It is worse: Word saves not the text, but a chunk
of memory. (I wrote about this a few weeks ago here).
So, in a word file, you can find everything which has been done
on that computer recently.

> Potentially this is a security problem, as information could reach
> a recipient other than the one it was intended for.

It is, and many companies (including ours) forbid to give Word files
to outside recipients.

Ralf
From: Espen Vestre
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <w64sryyq8f.fsf@gromit.nextel.no>
·············@t-online.de (Ralf Muschall) writes:

> Not necessary. It is worse: Word saves not the text, but a chunk
> of memory. (I wrote about this a few weeks ago here).
> So, in a word file, you can find everything which has been done
> on that computer recently.

there was a thread on this on BUGTRAQ lately.  Apparently, this
is the case for older OLE versions, but is fixed in newer Word versions
(but has been reincarnated in Word 98 for the mac).  (Search the
bugtraq archives at http://www.netspace.org if you're interested!)

--

  espen
From: Martti Halminen
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <36506C19.60AB@rm_spam_trap.dpe.fi>
eric dahlman wrote:
> 
> Hi all,
> 
> I know that this is not really on topic but I just found something
> that really confuses me.  I got an attached Word document in some
> email today and since I didn't want to go all the way up stairs to
> find a PC I just ran strings on the the thing to see if I could get
> the test out in a readable form.  The document was in Finnish and
> apparently strings doesn't know how to recognize that sort of stuff,
> but way came out was really interesting.  I have appended it to this
> post.
> 
> It certainly looks like some lisp code is embedded into file.  Or is
> this just some junk that got included some other way.  I know some of
> the file saving techniques used by MS Word are kind of sketchy when it
> comes to saving unzeroed newly allocated memory.  So what have I
> found?

> 
> <snipped to protect the innocent>
> 
> (defun styles ( / cs fb ff g h n o s w x)
>    (tblset "style")
>    (write-line "  Text style  Height  Width   Slant  Flags  Font      Bigfont")
>    (terpri)
>    (setq cs (getvar "textstyle"))       ; get current style

<snip>




You seem to have gotten some AutoLisp code (for AutoCAD) in the
document. If the actual contents didn't have anything with that to do,
then Word has grabbed some memory pages used by whatever editor the
sender uses.







-- 
________________________________________________________________
    ^.          Martti Halminen
   / \`.        Design Power Europe Oy
  /   \ `.      Tekniikantie 12, FIN-02150 Espoo, Finland
 /\`.  \ |      Tel:+358 9 4354 2306, Fax:+358 9 455 8575
/__\|___\|      ······················@dpe.fi   http://www.dpe.fi
From: Stig Hemmer
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <ekvemr38nts.fsf@verden.pvv.ntnu.no>
Rumour has it that MS-Word includes some unrelated bits and pieces of
memory when it saves its files. (Unzeroed malloc() as you say)

My guess would be that you are looking at something from another
program.  Steve Gonedes suggested emacs, but it doesn't look like
Emacs Lisp to me.  AutoCAD, perhaps?

Stig Hemmer,
Jack of a Few Trades.
From: Fernando D. Mato Mira
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <3652983D.C756B25C@acm.org>
Stig Hemmer wrote:

> Emacs Lisp to me.  AutoCAD, perhaps?

That's definitely Autolisp. Besides the 3D, LAYERS, BLOCKS references,
the `/ ' in the lambda list used to introduce local variables totally
betrays it (yuck!).

I loath Autolisp.

--
Fernando D. Mato Mira
Real-Time SW Eng & Networking
Advanced Systems Engineering Division
CSEM                                   HTTP:       www.csem.ch
Jaquet-Droz 1                         email:  ········@acm.org
CH-2007 Neuchatel                       tel: +41 (32) 720-5157
Switzerland                             FAX: +41 (32) 720-5720
From: MJM
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <365E3BE8.7D826514@multimania.com>
eric dahlman wrote:

> email today and since I didn't want to go all the way up stairs to
> find a PC I just ran strings on the the thing to see if I could get
> the test out in a readable form.  The document was in Finnish and

The answer is certainly that the Finnish language have been initially designed on
top
level of a LispOS entirely written from scratch in AutoLISP.

That's the ONLY answer.

mjm
From: MJM
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <365E3BBA.3251595@multimania.com>
eric dahlman wrote:

> email today and since I didn't want to go all the way up stairs to
> find a PC I just ran strings on the the thing to see if I could get
> the test out in a readable form.  The document was in Finnish and

The answer is certainly that the Finnish language have been initially designed on
top
level of a LispOS entirely written from scratch in AutoLISP.

That's the ONLY answer.

mjm
From: MJM
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <365E3B86.B91DB479@multimania.com>
eric dahlman wrote:

> email today and since I didn't want to go all the way up stairs to
> find a PC I just ran strings on the the thing to see if I could get
> the test out in a readable form.  The document was in Finnish and

The answer is certainly that the Finnish language have been initially designed on
top
level of a LispOS entirely written from scratch in AutoLISP.

That's the ONLY answer.

mjm
From: MJM
Subject: Re: Does MS Word use lisp???
Date: 
Message-ID: <365E3D91.8F0F3E52@multimania.com>
eric dahlman wrote:

> email today and since I didn't want to go all the way up stairs to
> find a PC I just ran strings on the the thing to see if I could get
> the test out in a readable form.  The document was in Finnish and

The answer is certainly that the Finnish language have been initially designed on
top
level of a LispOS entirely written from scratch in AutoLISP.

That's the ONLY answer.

mjm