OKlibrary  0.2.1.6
Strings.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 30.10.2011 (Swansea) */
00002 /* Copyright 2011, 2012 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00022 oklib_include("OKlib/ComputerAlgebra/DataStructures/Lisp/Lists.mac")$
00023 
00024 /* Print a string on one line, with exactly one line-break: */
00025 print_nlb(s) := printf(true,"~a~a",s,newline)$
00026 
00027 
00028 /* Concatening the string-arguments, separating them with new-lines: */
00029 sconcatnl([L]) := uaapply(sconcat, lappend(map(lambda([x],[x,newline]),L)))$
00030 /* Separating them with spaces: */
00031 sconcats([L]) := uaapply(sconcat, lappend(map(lambda([x],[x,space]),L)))$
00032 
00033 
00034 /* Evaluate term t, and concatenate all print-output into one string: */
00035 print2string('t) := block([S : make_string_output_stream()],
00036  with_stdout(S,ev(t)),
00037  get_output_stream_string(S))$
00038 
00039 
00040 /* String with standard creation-statement: */
00041 created_by_OKlib() := sconcat("Produced by OKlibrary (", oklibrary_domain, ", ID=", git_id_oklib, ") at ", timedate(), ".")$
00042 
00043