clisp-cvs Digest, Vol 27, Issue 35

View: New views
1 Messages — Rating Filter:   Alert me  

clisp-cvs Digest, Vol 27, Issue 35

by clisp-cvs-request :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Send clisp-cvs mailing list submissions to
        clisp-cvs@...

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/clisp-cvs
or, via email, send a message with subject or body 'help' to
        clisp-cvs-request@...

You can reach the person managing the list at
        clisp-cvs-owner@...

When replying, please edit your Subject line so it is more specific
than "Re: Contents of clisp-cvs digest..."


CLISP CVS commits for today

Today's Topics:

   1. clisp/src io.d,1.348,1.349 TODO,1.149,1.150
      ChangeLog,1.6403,1.6404 (Sam Steingold)
   2. clisp/tests iofkts.tst,1.50,1.51 (Sam Steingold)


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

Message: 1
Date: Sun, 20 Jul 2008 14:56:20 +0000
From: Sam Steingold <sds@...>
Subject: clisp/src io.d,1.348,1.349 TODO,1.149,1.150
        ChangeLog,1.6403,1.6404
To: clisp-cvs@...
Message-ID: <E1KKaKk-0001GM-2F@...>

Update of /cvsroot/clisp/clisp/src
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17838/src

Modified Files:
        io.d TODO ChangeLog
Log Message:
(justify_empty_2): concatenate all strings in a single-liner
into one string instead of pushing all the components into the block


Index: TODO
===================================================================
RCS file: /cvsroot/clisp/clisp/src/TODO,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -d -r1.149 -r1.150
--- TODO 18 Jul 2008 16:04:54 -0000 1.149
+++ TODO 20 Jul 2008 14:56:13 -0000 1.150
@@ -6,10 +6,6 @@
 Should handle these soon.
 
 
-Many pretty-printer ansi test failures.
-(sds - but bruno has to fix the risky-test in iofkts.tst first)
-
-
 Inefficiency of class redefinition when old or new class is unfinalizable
 
 

Index: io.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/io.d,v
retrieving revision 1.348
retrieving revision 1.349
diff -u -d -r1.348 -r1.349
--- io.d 18 Jul 2008 20:27:04 -0000 1.348
+++ io.d 20 Jul 2008 14:56:12 -0000 1.349
@@ -5767,20 +5767,44 @@
  can trigger GC */
 local maygc void justify_empty_2 (const gcv_object_t* stream_) {
   var object stream = *stream_;
-  var object new_cons = TheStream(stream)->strm_pphelp_strings;
+  var object new_cons;
   /* extend SYS::*PRIN-JBLOCKS* by the content of the Stream: */
-  if (eq(TheStream(stream)->strm_pphelp_modus,mehrzeiler) /* multi-liner. */
-      || !nullp(Cdr(new_cons))) {    /* many strings in the stream */
+  if (eq(TheStream(stream)->strm_pphelp_modus,mehrzeiler)) { /* multi-liner. */
     /* (push strings SYS::*PRIN-JBLOCKS*) */
     new_cons = allocate_cons(); /* new Cons */
     Car(new_cons) = TheStream(*stream_)->strm_pphelp_strings;
-  } /* else: single-liner & single string in the stream
-       (push (first strings) SYS::*PRIN-JBLOCKS*), or shorter:
-       (setq SYS::*PRIN-JBLOCKS* (rplacd strings SYS::*PRIN-JBLOCKS*)) */
+  } else {     /* single-liner. */
+    /* collect all constituent strings into one */
+    var uintL needed_len = 0;
+    var uintL string_count = 0;
+    new_cons = TheStream(stream)->strm_pphelp_strings;
+    for (; consp(new_cons); new_cons = Cdr(new_cons))
+      if (stringp(Car(new_cons))) {
+        pushSTACK(Car(new_cons));
+        needed_len += vector_length(STACK_0);
+        string_count++;
+      }
+    if (--string_count) { /* more than 1 string */
+      STACK_0 = ssstring_extend(STACK_0,needed_len);
+      var cint32* ptr = TheS32string(TheIarray(STACK_0)->data)->data
+        + vector_length(STACK_0);
+      do {              /* append STACK_1 to STACK_0 and drop STACK_1 */
+        var uintL len = vector_length(STACK_1);
+        var cint32* ptr1 = TheS32string(TheIarray(STACK_1)->data)->data;
+        while (len--) *ptr++ = *ptr1++;
+        STACK_1 = STACK_0;
+        skipSTACK(1);
+      } while (--string_count);
+      TheIarray(STACK_0)->dims[1] = needed_len;
+      Car(TheStream(*stream_)->strm_pphelp_strings) = popSTACK();
+    } else skipSTACK(1);        /* drop the only string */
+    /* (push (first strings) SYS::*PRIN-JBLOCKS*), or shorter:
+     (setq SYS::*PRIN-JBLOCKS* (rplacd strings SYS::*PRIN-JBLOCKS*)) */
+    new_cons = TheStream(*stream_)->strm_pphelp_strings;
+  }
   Cdr(new_cons) = Symbol_value(S(prin_jblocks));
   Symbol_value(S(prin_jblocks)) = new_cons;
 }
-
 /* UP: prints space, which can be stretched with Justify.
  justify_space(&stream);
  > stream: Stream

Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.6403
retrieving revision 1.6404
diff -u -d -r1.6403 -r1.6404
--- ChangeLog 18 Jul 2008 20:27:03 -0000 1.6403
+++ ChangeLog 20 Jul 2008 14:56:13 -0000 1.6404
@@ -1,3 +1,8 @@
+2008-07-20  Sam Steingold  <sds@...>
+
+ * io.d (justify_empty_2): concatenate all strings in a single-liner
+ into one string instead of pushing all the compoments into the block
+
 2008-07-18  Sam Steingold  <sds@...>
 
  * io.d (paren_open): a minor simplification




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

Message: 2
Date: Sun, 20 Jul 2008 14:56:14 +0000
From: Sam Steingold <sds@...>
Subject: clisp/tests iofkts.tst,1.50,1.51
To: clisp-cvs@...
Message-ID: <E1KKaL7-0001Oe-7w@...>

Update of /cvsroot/clisp/clisp/tests
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17838/tests

Modified Files:
        iofkts.tst
Log Message:
(justify_empty_2): concatenate all strings in a single-liner
into one string instead of pushing all the components into the block


Index: iofkts.tst
===================================================================
RCS file: /cvsroot/clisp/clisp/tests/iofkts.tst,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- iofkts.tst 18 Jul 2008 20:27:05 -0000 1.50
+++ iofkts.tst 20 Jul 2008 14:56:12 -0000 1.51
@@ -839,7 +839,7 @@
 (write-to-string (list (make-instance 'c2 'a 45 'bb 17 'aa 12)
                        (make-instance 'c2 'b 123 'cc 42))
                  :pretty t)
-"(#[C2 AA 12 BB 17 A 45] #[C2 CC 42 B 123])"
+"(#[C2 A 45 AA 12 BB 17] #[C2 B 123 CC 42])"
 
 (let ((*print-readably* t))
   (with-output-to-string (out) (pprint-linear out (list 'a 'b 'c))))




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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

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

_______________________________________________
clisp-cvs mailing list
clisp-cvs@...
https://lists.sourceforge.net/lists/listinfo/clisp-cvs


End of clisp-cvs Digest, Vol 27, Issue 35
*****************************************

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
clisp-devel mailing list
clisp-devel@...
https://lists.sourceforge.net/lists/listinfo/clisp-devel