Commit 28c496a2 authored by Raymond Toy's avatar Raymond Toy
Browse files

Fix up implementation of CYCLE and EXIT.

f2cl1.l:
o Go to f2cl-lib::exit instead of loop because that bypasses the update
  of the loop variable.

macros.l:
o Have the FDO macro insert the CONTINUE and EXIT labels at the
  appropriate places so that the CYCLE and EXIT code goes to the right
  places.
parent ee7eedeb
......@@ -17,7 +17,7 @@
"Use (f2cl-version) instead")
(defparameter *f2cl1-version*
"$Id: f2cl1.l,v 5ee73ed2713b 2011/11/23 21:02:33 toy $")
"$Id: f2cl1.l,v c4abe8cf9af0 2011/11/24 07:12:32 toy $")
;; Forward declarations.
(defvar *f2cl2-version*)
......@@ -2944,7 +2944,7 @@ correctly"
'((go f2cl-lib::exit)))
(defun parse-cycle (x)
'((go loop)))
'((go f2cl-lib::continue)))
;=============================================================================
;parsing utilities
......@@ -3345,7 +3345,7 @@ loop2
;;;-----------------------------------------------------------------------------
;;; end of f2cl1.l
;;;
;;; $Id: f2cl1.l,v 5ee73ed2713b 2011/11/23 21:02:33 toy $
;;; $Id: f2cl1.l,v c4abe8cf9af0 2011/11/24 07:12:32 toy $
;;; $Log$
;;; Revision 1.222 2010/10/08 03:05:30 rtoy
;;; src/f2cl1.l:
......
......@@ -6,7 +6,7 @@
(in-package :f2cl-lib)
(defparameter *f2cl-macros-version*
"$Id: macros.l,v 5ee73ed2713b 2011/11/23 21:02:33 toy $")
"$Id: macros.l,v c4abe8cf9af0 2011/11/24 07:12:32 toy $")
(eval-when
#+gcl (compile load eval)
......@@ -261,12 +261,14 @@ is not included")
(cond ; all iterations done
((zerop ,iteration_count) nil)
;; execute loop, in/de-crement loop vble and decrement cntr
,(cons 't
(append
(append body
`((setq ,loop-var (the integer4 ,(third do_vble_clause))
,iteration_count (the integer4 (1- ,iteration_count)))))
'((go loop))))))
,(list 't
(append '(tagbody)
(append
(append body
`(continue
(setq ,loop-var (the integer4 ,(third do_vble_clause))
,iteration_count (the integer4 (1- ,iteration_count)))))
'((go loop)))))))
exit)))
;;----------------------------------------------------------------------------
......@@ -1528,7 +1530,7 @@ causing all pending operations to be flushed"
;;;-------------------------------------------------------------------------
;;; end of macros.l
;;;
;;; $Id: macros.l,v 5ee73ed2713b 2011/11/23 21:02:33 toy $
;;; $Id: macros.l,v c4abe8cf9af0 2011/11/24 07:12:32 toy $
;;; $Log$
;;; Revision 1.117 2011/02/28 22:21:07 rtoy
;;; When opening an old file, we should set :if-exists to :overwrite to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment