The s-utils Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The s-utils Reference Manual

This is the s-utils Reference Manual, version 1, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:18:49 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

S-UTILS

A collection of Common Lisp utilities

S-UTILS is collection of Common Lisp utilities. This simple package is used as a building block in a number of other open source projects.

Contents

Features

S-UTILS helps in:

Status

S-UTILS is considered stable code.

News

November 2005 - Created as a separate project.

Platforms

S-UTILS is written in ANSI standard Common Lisp and should be portable across any CL implementation.

Installation

The S-UTILS package is loaded using ASDF. There is an excellent tutorial on ASDF to get you started.

CL-USER 1 > (asdf:oos 'asdf:load-op :s-utils)

Example of setting up and using ASDF to compile and load the package

Usage

Usage of the functionality in S-UTILS is straightforward, as the following examples demonstrate:

CL-USER 1 > (in-package :s-utils)
#<The S-UTILS package, 41/128 internal, 13/16 external>

S-UTILS 2 > (defvar *timestamp* (get-universal-time))
*TIMESTAMP*

S-UTILS 3 > (format-universal-time *timestamp*)
"Sat Nov 19 2005 18:08:51"

S-UTILS 4 > (format-iso-gmt-time *timestamp*)
"20051119T170851"

S-UTILS 5 > (format-universal-time *timestamp* :format +us-date-format+ :stream t) 
Sat Nov 19 2005
NIL

S-UTILS 6 > (format-universal-time *timestamp* :format +us-time-format+ :timezone 0)
"Sat Nov 19 2005 17:08:51"

S-UTILS 7 > (format-duration (- (get-universal-time) *timestamp*))
"5 minutes 18 seconds"

S-UTILS 8 > (tokens *)
("5" "minutes" "18" "seconds")

S-UTILS 9 > (tokens "1-2-3-4-5" :separators '(#\-))
("1" "2" "3" "4" "5")

S-UTILS 10 > (parse-integer-safely "")
NIL

S-UTILS 11 > (parse-integer-safely "x" :default -1)
-1

S-UTILS 12 > (parse-integer-safely "111" :default 123 :start 2)
1

S-UTILS 13 > (parse-integer-safely "111" :default 123 :start 3)
123

S-UTILS 14 > (parse-integer-safely "" :default -1)
-1

S-UTILS 15 > (parse-integer-safely nil :default -1)
-1

S-UTILS 16 > (parse-integer-safely "FF" :radix 16)
255

S-UTILS 17 > (with-input-from-string (in "abcdefghi")
               (copy-stream in *standard-output*)
               (terpri))
abcdefghi
NIL

S-UTILS 18 > (make-subdirectory #p"/tmp/" '("foo" "bar"))
#P"/tmp/foo/bar/"

S-UTILS 19 > (pathname-parent #p"/tmp/")
#P"/"

S-UTILS 20 > (pathname-parent (make-subdirectory #p"/tmp/" "foo"))
#P"/tmp/"

API Reference

There is automatically generated documentation available for the S-UTILS package in doc/API.html.

Mailinglist

There is no mailing list for this project.

Changelog

Release Notes:

TODO

There is currently no TODO list.

FAQ

Nothing appropriate.

Bugs

There are no known bugs.

Authors

S-UTILS was written by Sven Van Caekenberghe.

Maintainers

S-UTILS is being maintained by Sven Van Caekenberghe.

License

You are granted the rights to distribute and use this software as governed by the terms of the Lisp Lesser General Public License (http://opensource.franz.com/preamble.html), also known as the LLGPL.

History

This is a new project.

References

Thera are no references.

Copyright © 2004-2005 Sven Van Caekenberghe, Beta Nine BVBA. All Right Reserved


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 s-utils

Maintainer

Sven Van Caekenberghe <svc@mac.com>

Author

Sven Van Caekenberghe <svc@mac.com>

License

Lesser Lisp General Public License (LLGPL)

Description

S-UTILS is collection of Common Lisp utilities

Long Description

S-UTILS is collection of Common Lisp utilities

Version

1

Source

s-utils.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 s-utils/src

Parent

s-utils (system)

Location

src/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 s-utils.asd

Location

s-utils.asd

Systems

s-utils (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 s-utils/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

s-utils


Previous: , Up: Lisp files   [Contents][Index]

4.1.3 s-utils/src/utils.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

src/utils.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 s-utils

S-UTILS is collection of Common Lisp utilities

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Special variables

Special Variable: +en-duration-unit-names+

English time duration unit name constant strings

Package

s-utils

Source

utils.lisp (file)

Special Variable: +us-date-format+

US English style date-only format

Package

s-utils

Source

utils.lisp (file)

Special Variable: +us-day-names+

US English short day name constant strings

Package

s-utils

Source

utils.lisp (file)

Special Variable: +us-month-names+

US English short month name constant strings

Package

s-utils

Source

utils.lisp (file)

Special Variable: +us-time-format+

US English style date-time format

Package

s-utils

Source

utils.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Functions

Function: copy-stream IN OUT &optional BUFFER SECOND-BUFFER CONVERTOR

Copy all data from input stream in to output stream out using buffer (and read/write-sequence)

Package

s-utils

Source

utils.lisp (file)

Function: format-duration SECONDS &key UNIT-NAMES STREAM

Format seconds as duration using unit-names, if stream is not nil use it, else return a string

Package

s-utils

Source

utils.lisp (file)

Function: format-iso-gmt-time UNIVERSAL-TIME &key STREAM

Format universal time using a simple and fast ’ISO GMT’ style, if stream is not nil use it, else return a string

Package

s-utils

Source

utils.lisp (file)

Function: format-universal-time UNIVERSAL-TIME &key FORMAT DAY-NAMES MONTH-NAMES DECODE-IN-TIMEZONE STREAM

Format universal time using format, day-names and month-names, if stream is not nil use it, else return a string

Package

s-utils

Source

utils.lisp (file)

Function: make-subdirectory BASEDIR SUBDIR

Give a pathname, basedir, of a directory, create a subdirectory with name subdir

Package

s-utils

Source

utils.lisp (file)

Function: parse-integer-safely STRING &key START END RADIX DEFAULT

Like parse-integer, but will return default on error, accepts nil as argument

Package

s-utils

Source

utils.lisp (file)

Function: pathname-parent PATHNAME

Given a pathname, return the parent pathname

Package

s-utils

Source

utils.lisp (file)

Function: tokens STRING &key START END SEPARATORS

Split string in a list of tokens using separators, a list of characters

Package

s-utils

Source

utils.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M   S  
Index Entry  Section

F
File, Lisp, s-utils.asd: The s-utils<dot>asd file
File, Lisp, s-utils/src/package.lisp: The s-utils/src/package<dot>lisp file
File, Lisp, s-utils/src/utils.lisp: The s-utils/src/utils<dot>lisp file

L
Lisp File, s-utils.asd: The s-utils<dot>asd file
Lisp File, s-utils/src/package.lisp: The s-utils/src/package<dot>lisp file
Lisp File, s-utils/src/utils.lisp: The s-utils/src/utils<dot>lisp file

M
Module, s-utils/src: The s-utils/src module

S
s-utils.asd: The s-utils<dot>asd file
s-utils/src: The s-utils/src module
s-utils/src/package.lisp: The s-utils/src/package<dot>lisp file
s-utils/src/utils.lisp: The s-utils/src/utils<dot>lisp file

Jump to:   F   L   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   F   M   P   T  
Index Entry  Section

C
copy-stream: Exported functions

F
format-duration: Exported functions
format-iso-gmt-time: Exported functions
format-universal-time: Exported functions
Function, copy-stream: Exported functions
Function, format-duration: Exported functions
Function, format-iso-gmt-time: Exported functions
Function, format-universal-time: Exported functions
Function, make-subdirectory: Exported functions
Function, parse-integer-safely: Exported functions
Function, pathname-parent: Exported functions
Function, tokens: Exported functions

M
make-subdirectory: Exported functions

P
parse-integer-safely: Exported functions
pathname-parent: Exported functions

T
tokens: Exported functions

Jump to:   C   F   M   P   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
S  
Index Entry  Section

+
+en-duration-unit-names+: Exported special variables
+us-date-format+: Exported special variables
+us-day-names+: Exported special variables
+us-month-names+: Exported special variables
+us-time-format+: Exported special variables

S
Special Variable, +en-duration-unit-names+: Exported special variables
Special Variable, +us-date-format+: Exported special variables
Special Variable, +us-day-names+: Exported special variables
Special Variable, +us-month-names+: Exported special variables
Special Variable, +us-time-format+: Exported special variables

Jump to:   +  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S  
Index Entry  Section

P
Package, s-utils: The s-utils package

S
s-utils: The s-utils system
s-utils: The s-utils package
System, s-utils: The s-utils system

Jump to:   P   S