#lang scribble/doc @; THIS FILE IS GENERATED @(require scribble/manual) @(require (for-label (planet neil/tabexpand:1:1))) @title[#:version "0.3"]{@bold{tabexpand}: Tab Character Expansion in Scheme} @author{Neil Van Dyke} License: @seclink["Legal" #:underline? #f]{LGPL 3} @(hspace 1) Web: @link["http://www.neilvandyke.org/tabexpand-scheme/" #:underline? #f]{http://www.neilvandyke.org/tabexpand-scheme/} @defmodule[(planet neil/tabexpand:1:1)] @section{Introduction} There is no denying that ASCII tab characters are an archaic abomination. Savvy Emacs users might have noticed that the @link["http://www.neilvandyke.org/quack/"]{Quack} option variable @tt{quack-tabs-are-evil-p} defaults to true. Note also that @tt{quack-tidy} gladly slays any tab in sight, laughing maniacally as only the truly righteous can. Sadly, not all strings in the universe are Scheme code subject to the wrath of Quack, therefore... This very simple Scheme library provides procedures for expanding tab characters. It was written early one Sunday morning to complement the plethora of PLT-specific solutions being offered to the problem on the nascent Schematics cookbook Wiki. Its source code is a bit verbose, but it tries not to generate much garbage, it supports non-zero starting columns, and it should work with any R5RS Scheme implementation that supports SRFI-6. (A future edition of this continuing epic might remove the dependency on SRFI-6, should we bother to benchmark and find that some implementations are not as efficient as we'd like.) At time of this writing, the author notes with no small amount of interest that the Internet domain name @tt{tabexpand.com} has not yet been taken. @section{Procedures} Three procedures are provided. Most applications will use the simple @tt{tabexpand}. @defproc[(tabexpand/stop/col (str any/c) (stop any/c) (col any/c)) any/c]{} @defproc[(tabexpand/stop (str any/c) (stop any/c)) any/c]{} @defproc[(tabexpand (str any/c)) any/c]{ Yields a new string that is equivalent to string @schemevarfont{str} except that any ASCII tab characters have been expanded to space characters. @schemevarfont{stop}, a positive integer defaulting to @tt{8}, is used as the tabstop. @schemevarfont{col}, a nonnegative integer defaulting to @tt{0}, is the context starting column for the beginning of the string, with respect to which tabs positions should be calculated. All characters other than tab are treated as if they were normal printable characters with no special effect on the column. } @section{History} @itemize[ @item{Version 0.3 --- 2009-03-03 --- PLaneT @tt{(1 1)} License is now LGPL 3. Converted to author's new Scheme administration system. } @item{Version 0.2 --- 2005-02-24 --- PLaneT @tt{(1 0)} Added Testeez test cases. Packaged for PLaneT. } @item{Version 0.1 --- 2004-05-09 Wrote as a joke that also made a point about code patterns vs. libraries. } ] @section[#:tag "Legal"]{Legal} Copyright (c) 2004--2009 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License (LGPL 3), or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author.