Changeset 71f6706 in git for Singular/LIB/standard.lib


Ignore:
Timestamp:
Apr 22, 1999, 10:35:12 AM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
25ea20d6d662e7545fe93d42f9d3e76d73f44beb
Parents:
8dd3ac7f1579c1f59cd86191b12b185a2ab8dab0
Message:
* changes in examples of sprintf


git-svn-id: file:///usr/local/Singular/svn/trunk@3006 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/standard.lib

    r8dd3ac r71f6706  
    1 // $Id: standard.lib,v 1.28 1999-04-19 13:20:02 obachman Exp $
     1// $Id: standard.lib,v 1.29 1999-04-22 08:35:12 obachman Exp $
    22//////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: standard.lib,v 1.28 1999-04-19 13:20:02 obachman Exp $";
     4version="$Id: standard.lib,v 1.29 1999-04-22 08:35:12 obachman Exp $";
    55info="
    66LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
     
    735735          except that the string may contain conversion specifications. Do
    736736          'help print:' for a listing of valid conversion specifications.
     737          As an addition to the conversions of 'print', the '%n' and '%2'
     738          conversion specification does not consume an additional argument,
     739          but simply generates a newline character.
    737740NOTE:     If one of the additional arguments is a list, then it should be
    738741          enclosed once more into a list() command, since passing a list
     
    748751  int next, l, nnext;
    749752  string ret;
    750   list formats = "%l", "%s", "%2l", "%2s", "%t", "%;", "%p", "%b";
     753  list formats = "%l", "%s", "%2l", "%2s", "%t", "%;", "%p", "%b", "%n", "%2";
    751754  while (1)
    752755  {
     
    777780      return (ret + fmt);
    778781    }
    779     ret = ret + fmt[1, next - 1] + print(#[1], formats[l]);
     782    if (formats[l] != "%2" && formats[l] != "%n")
     783    {
     784      ret = ret + fmt[1, next - 1] + print(#[1], formats[l]);
     785      # = delete(#, 1);
     786    }
     787    else
     788    {
     789      ret = ret + fmt[1, next - 1] + print("", "%2s");
     790    }
    780791    if (size(fmt) <= (next + size(formats[l]) - 1))
    781792    {
    782793      return (ret);
    783794    }
    784     # = delete(#, 1);
    785795    fmt = fmt[next + size(formats[l]), size(fmt)-next-size(formats[l]) + 1];
    786796  }
     
    792802  intmat M=betti(mres(m,0));
    793803  list l = r, m, M;
    794   string s = sprintf("s:%s, l:%l", 1, 2); s;
    795   s = sprintf("s:%s", l); s;
    796   s = sprintf("s:%s", list(l)); s;
    797   s = sprintf("2l:%2l", list(l)); s;
     804  string s = sprintf("s:%s,%n l:%l", 1, 2); s;
     805  s = sprintf("s:%n%s", l); s;
     806  s = sprintf("s:%2%s", list(l)); s;
     807  s = sprintf("2l:%n%2l", list(l)); s;
    798808  s = sprintf("%p", list(l)); s;
    799809  s = sprintf("%;", list(l)); s;
     
    812822          string may contain conversion specifications.
    813823          Do 'help print:' for a listing of valid conversion specifications.
     824          As an addition to the conversions of 'print', the '%n' and '%2'
     825          conversion specification does not consume an additional argument,
     826          but simply generates a newline character.
    814827
    815828NOTE:     If one of the additional arguments is a list, then it should be
     
    849862          string may contain conversion specifications.
    850863          Do 'help print:' for a listing of valid conversion specifications.
     864          As an addition to the conversions of 'print', the '%n' and '%2'
     865          conversion specification does not consume an additional argument,
     866          but simply generates a newline character.
    851867
    852868NOTE:     If one of the additional arguments is a list, then it should be
Note: See TracChangeset for help on using the changeset viewer.