gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Nested progs and return with GCL-2.7.0


From: Vanuxem Gregory
Subject: [Gcl-devel] Nested progs and return with GCL-2.7.0
Date: Sat, 02 Dec 2006 20:56:14 +0100

Hello,

With GCL checked out today  (2.7.0 CLtL1 build) the following code never
returns "string processed" when it is compiled :

(defun test (str i)
 (prog (|maxIndex| k)
   (setq |maxIndex| (- (length str) 1))
   (return (progn
     (setq k 
       (or
         (prog (#1=#:G550524) 
           (setq #1# nil)
           (return 
             (do ((#2=#:G550531 nil #1#) (j i (+ j 1)))
                 ((or #2# (> j |maxIndex|)) #1#)
                 (if (cond 
                       ((equal (elt str j) #\Space)
                         (setq #1# (or #1# j))))
                     (return #1#)))))
         (return "string processed")))
     (print "work with k")
     k))))


The code (automatically generated), basically, finds the index (greater
than i) of a \#Space in a string.

Test it with :

[99]> (test "hello and bye"  10)
"string processed"
[100]> (test "hello and bye"  6)
"work with k" 
9

Greg





reply via email to

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