emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Local variables list is not properly terminated"


From: Bill Greene
Subject: "Local variables list is not properly terminated"
Date: Thu, 17 May 2007 14:12:17 -0400

From: Bill Greene <address@hidden>
To: address@hidden
Subject: "Local variables list is not properly terminated"
Reply-to: address@hidden
--text follows this line--
My .emacs file issues this call:

        (find-file "~/.rosetta.txt" nil)  ;; Originally, I left the 'nil' 
off, to no effect.

~/.rosetta.txt is somewhat unusual in that it does contain elisp code.
The file is not that big, so I'm going to include it here:
== START INCLUDED FILE: ==

-------------------------------------------------------------------------------
--                                   Ada   --
-------------------------------------------------------------------------------

--------------------------------------------------------------
-- How to specify the actual physical address of an object. --
--------------------------------------------------------------

-- Ada uses the "attribute definition clause" [RM 13.3].

   -- The type:
   type Extended_BIOS_Data_Area is
      record
         ...
      end record;

   -- The object of the type and its location:
   EBDA : Extended_BIOS_Data_Area;
   for EBDA'Address use 16#0000_040E#;

///////////////////////////////////////////////////////////////////////////////
//                                   C++   //
///////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////
// How to specify the actual physical address of an object. //
//////////////////////////////////////////////////////////////

// C++ uses the "reinterpret_cast" explicit type conversion operator
// [BS 6.2.7 and 10.4.11].

   // The type:
   typedef struct {
      ...
   } Extended_BIOS_Data_Area;

   // The object of the type and its location:
   Extended_BIOS_Data_Area* EBDA =
      reinterpret_cast<Extended_BIOS_Data_Area*>(0x0000040E);

//: C04:nl.cpp in 
file:///C:/cygwin/home/BillGreene/downloads/TICPP-2nd-ed-Vol-two/html/TicV2.html#_Toc53985695
// Creating a manipulator.
#include <iostream>
using namespace std;

ostream& nl (ostream& os) {
  return os << '\n';
}

int main () {
  cout << "newlines" << nl << "between" << nl
       << "each" << nl << "word" << nl;
} ///:~

//: C04:Effector.cpp in 
file:///C:/cygwin/home/BillGreene/downloads/TICPP-2nd-ed-Vol-two/html/TicV2.html#_Toc312373896
// Jerry Schwarz's "effectors."
#include <cassert>
#include <limits>  // For max()
#include <sstream>
#include <string>
using namespace std;

// Put out a prefix of a string:
class Fixw {
  string str;
public:
  Fixw(const string& s, int width) : str(s, 0, width) {}
  friend ostream& operator<<(ostream& os, const Fixw& fw) {
    return os << fw.str;
  }
};

// Print a number in binary:
typedef unsigned long ulong;

class Bin {
  ulong n;
public:
  Bin(ulong nn) { n = nn; }
  friend ostream& operator<<(ostream& os, const Bin& b) {
    const ulong ULMAX = numeric_limits<ulong>::max();
    ulong bit = ~(ULMAX >> 1); // Top bit set
    while(bit) {
      os << (b.n & bit ? '1' : '0');
      bit >>= 1;
    }
    return os;
  }
};

int main() {
  string words = "Things that make us happy, make us wise";
  for(int i = words.size(); --i >= 0;) {
    ostringstream s;
    s << Fixw(words, i);
    assert(s.str() == words.substr(0, i));
  }
  ostringstream xs, ys;
  xs << Bin(0xCAFEBABEUL);
  assert(xs.str() ==
    "1100""1010""1111""1110""1011""1010""1011""1110");
  ys << Bin(0x76543210UL);
  assert(ys.str() ==
    "0111""0110""0101""0100""0011""0010""0001""0000");
} ///:~
===============================================================================
==                               References   ==
===============================================================================

[BS]
   Bjarne Stroustrup, "The C++ Programming Language", Special Edition, 
2000.
   ISBN 0-201-70073-5.

[RM]
   "Ada 2005 Reference Manual: Language and Standard Libraries, 
International
   Standard ISO/IEC 8652:1995(E) with Technical Corrigendum 1 and 
Amendment 1."
   2006.

   Print version:
      S. Tucker Taft, Robert A. Duff, Randall L. Brukardt, Erhard 
Ploedereder,
      Pascal Leroy (editors).  Lecture Notes in Computer Science, Vol. 
4348.
      ISBN-10 3-540-69335-1
      ISBN-13 978-3-540-69335-2

   Online versions:
      http://www.adaic.com/standards/ada05.html
      http://www.adaic.org/standards/05rm/html/RM-TTL.html

===============================================================================
==                             Open questions   ==
===============================================================================

C++ equivalent of subprograms local to an Ada package body?

C++ equivalent of an Ada deferred constant in a package spec?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                  elisp   ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Declaration and initialization of an integer variable:
(defvar V1 17 "Description of what V1 is for.")  ;; Assignment of value 
'17' is not done if variable 'V1' already has a value.
(setq   V2 13) ;; Implicitly defines variable 'V2' if it is not already 
defined, unconditionally sets its value to '13'.

;; Assignment to a variable:
(setq V3 5)

;; Definition of a constant:
(defconst K1  3     "Description of what K1 is for.")
(defconst K2 (F K1) "Description of what K2 is for.")

;; Declaring and initializing local variables:
(let ((V4 2)
      (V5 1)
      (V6 7)
   S1 S2 ... Sn)







;; Sequence of expressions:
(progn S1 S2 ... Sn)






;; Control structures:

;; Assumed:
;;    'S', 'S1' ... 'Sn' are functions without arguments.
;;    'F' is a function with    arguments 'A1', .., 'An'.
;;    'X', 'X1', ... 'Xn' are expressions.

(if  B (S))  ;; Where 'B' is a variable.
(if (B (S))) ;; Where 'B' is a function.


(if B S             ;; 'S' is simple 'then' part;
      S1 S2 ... Sn) ;; 'S1' ... 'Sn' is compound 'else' part.




(when B
   S1 S2 ... Sn)




(unless B
   S1 S2 ... Sn)





(if B1
    S1
    (if B2
        S2
        (if B3
            S3))
      S4)))
;; or (better)
(cond (B1 S1)
      (B2 S2)
      (B3 S3)
      (t  S4))

;; case?

;; for loop?

(while B (S))

;; exit when?


-------------------------------------------------------------------------------
--                                   Ada   --
-------------------------------------------------------------------------------

-- Declaration and initialization of an integer variable:
V1 : Integer := 17;  -- Description of what V1 is for.


-- Assignment to a variable:
V3 := 5;

-- Definition of a constant:
K1 : constant Integer := 3;       -- Description of what K1 is for.
K2 : constant Integer := F (K1);  -- Description of what K2 is for.

-- Declaring and initializing local variables:
declare
   V4 : Integer := 2;
   V5 : Integer := 1;
   V6 : Integer := 7;
begin
   S1;
   S2;
   ...
   Sn;
end;

-- Sequence of expressions:
begin
   S1;
   S2;
   ...
   Sn;
end;

-- Control structures:

-- Assumed:
--    'S', 'S1', ... 'Sn' are statements.
--    'B', 'B1', ... 'Bn' are boolean expressions.
--    'X', 'X1', ... 'Xn' are expressions.

if B then  -- Same syntax whether 'B' is a variable or a function.
   S;
end if;

if B then
   S;   -- 'S' and 'S1' can each be simple or compound, ...
else
   S1;  -- ... that is, each can be a statement or a sequence of 
statements.
end if;

if B then
   S1;
   S2;
   ...
   Sn;
end if;

if not B then
   S1;
   S2;
   ...
   Sn;
end if;

if B1 then
   S1;
elsif B2 then
   S2;
elsif B3
   S3;
else
   S4
end if;

case X1 is
   when X1     => S1;
   when X2     => S2;
   when others => S3;
end case;

for X in X1 .. Xn loop
   S;
end loop;

while B loop
   S;
end loop;

loop
   exit when B;
   S;
end loop;

loop
   S1;
   exit when B1;
   S2;
   exit when B2;
end loop;

-- This here comment is to prevent NTEmacs' elisp from signaling 'error 
("Local variables list is not properly terminated")'.
-- Apparently it thinks the loop above is a list of local variables.
== END OF INCLUDED FILE. ==


In GNU Emacs 23.0.0.1 (i386-mingw-nt5.1.2600)
 of 2007-01-01 on DTOP
X server distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.1) --cflags  -O2 -g0 -march=i386 
-mtune=i686 -pipe -IC:/gnuwin32/include_emacs -IC:/gnuwin32/lib 
-IC:/gnuwin32/src --ldflags  -s '

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  shell-dirtrack-mode: t
  display-time-mode: t
  which-function-mode: t
  show-paren-mode: t
  recentf-mode: t
  encoded-kbd-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<escape> x m a x i SPC <return> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<menu-bar> <help-menu> <describe-distribution> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar> 
<help-menu> <about> <next> <prior> <prior> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<menu-bar> <help-menu> <report-emacs-bug>

Recent messages:
Fontifying which.ada... (regexps..............)
Loading skeleton...done
Tracepoint 1
Loading debug...done
Entering debugger...
Server subprocess exited
Loading vc-cvs...done
View mode: type C-h for help, h for commands, q to quit.
call-interactively: Beginning of buffer
Loading emacsbug...done





reply via email to

[Prev in Thread] Current Thread [Next in Thread]