Changeset 2486 in project


Ignore:
Timestamp:
11/20/06 14:58:50 (15 years ago)
Author:
felix winkelmann
Message:

packedobjects update, fixed wiki link in egg-post-commit, opengl: removed unnecessary files

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • egg-post-commit

    r2418 r2486  
    1414
    1515
    16 (define-constant +coop-egg-index-page+ "galinha.ucpel.tche.br/coop?page=egg%20index")
     16(define-constant +coop-egg-index-page+ "chicken.wiki.br/coop?page=egg%20index")
    1717(define-constant +call/cc-ftp-url+ "www.call-with-current-continuation.org")
    1818(define-constant +call/cc-eggs-url+ "http://www.call-with-current-continuation.org/eggs")
  • opengl/opengl.html

    r1932 r2486  
    1616<h3>Version:</h3>
    1717<ul>
     18<li>1.15
     19Removed .svn directory from wrapped egg [reported by Brandon Van Every]
    1820<li>1.14
    1921Fixed bug in .setup script [Thanks to Brandon van Every]
  • opengl/opengl.meta

    r2119 r2486  
    1212        "gl.scm"
    1313        "glu.scm"
    14         "glprocs"
     14        "glprocs/GL/glext.h"
     15        "glprocs/GL/gl.h"
     16        "glprocs/GL/glprocs.h"
     17        "glprocs/GL/wglext.h"
    1518        "glprocs.c"
    1619        "sdl-gears.scm"
  • opengl/opengl.setup

    r1932 r2486  
    2222 'gl
    2323 '("gl.so" "glu.so")
    24  '((version 1.14)
     24 '((version 1.15)
    2525   (examples "sdl-gears.scm")
    2626   (documentation "opengl.html")))
  • packedobjects/eggdoc-packedobjects.scm

    r1197 r2486  
    4646     (author "John P. T. Moore")
    4747
    48      (history (version "0.5" "Alpha release"))
     48     (history
     49       (version "0.66" "")
     50       (version "0.5" "Alpha release"))
    4951
    5052     (usage)
  • packedobjects/packedobjects.html

    r2271 r2486  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><!-- Generated by egg-post-commit from the wiki, revision $Rev: 2255 $ --><html><head><title>Eggs Unlimited - packedobjects</title><link rel='stylesheet' type='text/css' href='http://www.call-with-current-continuation.org/eggs/style.css'/><base href='http://chicken.freaks-unidos.net'/></head><body><div id='header'><h2>packedobjects</h2><div id='eggheader'><a href='http://www.call-with-current-continuation.org/eggs/index.html'><img src='http://www.call-with-current-continuation.org/eggs/egg.jpg' alt='egg'/></a></div></div><div id='body'><p><b>Note: </b>This is taken from <a href='http://chicken.freaks-unidos.net/packedobjects'>the Chicken Wiki</a>, where a more recent version could be available.</p><p></p><a name='Introduction'><h1>Introduction</h1></a><p>packedobjects is a data encoding tool based on the telecommunications standard Packed Encoding Rules (PER). An abstract syntax language is used to define a protocol specification. packedobjects uses the Scheme programming language to represent the protocol specification within a symbolic expression (s-expression).</p><p>packedobjects is suitable for simple cross platform request/response protocols that require efficient encoding. </p><p>So far packedobjects has been run on the following platforms:</p><ul><li>Mac OS X (PowerPC)</li><li>Linux (PowerPC)</li><li>Linux (Intel)</li><li>Linux (ARM)</li><li>NetBSD (alpha)</li></ul><p>For a more detailed introduction refer to the following short <a href='http://zedstar.org/papers/packedobjects.pdf' class='external'>paper</a>.</p><a name='Author'><h1>Author</h1></a><p>John P. T. Moore</p><p></p><a name='Version'><h1>Version</h1></a><p>0.63</p><a name='Building from subversion repository'><h1>Building from subversion repository</h1></a><p><tt>svn checkout https://anonymous:@galinha.ucpel.tche.br/svn/chicken-eggs/packedobjects</tt></p><p><tt>chicken-setup packedobjects.setup</tt></p><a name='Usage'><h1>Usage</h1></a><p><tt>(packedobjects &lt;protocol&gt; #!key &lt;pdusize&gt; &lt;strsize&gt;)</tt></p><p>Creates a packedobject using the supplied protocol specification. Optional values for the PDU and string buffer sizes can be specified. They default to 5000 and 1000 respectively. Both the PDU buffer and string buffer are fixed in size. The string buffer must be large enough to handle any string used by the protocol. The PDU buffer must be manually freed.</p><p><tt>(&lt;packedobject&gt; 'pack &lt;values&gt;)</tt></p><p>Encodes a list of values and returns the number of bytes used.</p><p><tt>(&lt;packedobject&gt; 'unpack)</tt></p><p>Returns a list of values.</p><p><tt>(&lt;packedobject&gt; 'read &lt;fd&gt; &lt;size&gt;)</tt></p><p>Reads a number of bytes from a file descriptor into the PDU buffer.</p><p><tt>(&lt;packedobject&gt; 'write &lt;fd&gt; &lt;size&gt;)</tt></p><p>Writes a number of bytes from the PDU buffer to a file descriptor.</p><p><tt>(&lt;packedobject&gt; 'read-message &lt;fd&gt;)</tt></p><p>Reads a message from a file descriptor into the PDU buffer.</p><p><tt>(&lt;packedobject&gt; 'write-message &lt;fd&gt; &lt;size&gt;)</tt></p><p>Writes a message containing a number of bytes from the PDU buffer to a file descriptor.</p><p>A message consists of the encoded data plus a 2 byte header representing the length of the message. Therefore, the maximum message size is 2^16-1 bytes.</p><p><tt>(&lt;packedobject&gt; 'dump-buffer &lt;filename&gt; &lt;size&gt;)</tt></p><p>Dumps a number of bytes from the PDU buffer to a file.</p><p><tt>(&lt;packedobject&gt; 'free)</tt></p><p>Frees the PDU buffer.</p><a name='Data types with examples'><h1>Data types with examples</h1></a><p>The following data types are currently supported.</p><a name='string'><h2>string</h2></a><dl><dt>protocol</dt><dd><tt>(foobar string (size 1 10))</tt></dd><dt>values</dt><dd><tt>(foobar "foobar")</tt></dd><dt>description</dt><dd>7 bit string limited to 10 characters in length.</dd></dl><a name='octet-string'><h2>octet-string</h2></a><dl><dt>protocol</dt><dd><tt>(foobar octet-string ())</tt></dd><dt>values</dt><dd><tt>(foobar "foobar")</tt></dd><dt>description</dt><dd>8 bit string with no length restriction.</dd></dl><a name='bit-string'><h2>bit-string</h2></a><dl><dt>protocol</dt><dd><tt>(foobar bit-string (size 8))</tt></dd><dt>values</dt><dd><tt>(foobar "10101010")</tt></dd><dt>description</dt><dd>Bitstring fixed in length.</dd></dl><a name='hex-string'><h2>hex-string</h2></a><dl><dt>protocol</dt><dd><tt>(foobar hex-string (size 1 max))</tt></dd><dt>values</dt><dd><tt>(foobar "afafaf")</tt></dd><dt>description</dt><dd>String of hexadecimal characters with no length restriction.</dd></dl><a name='integer'><h2>integer</h2></a><dl><dt>protocol</dt><dd><tt>(foobar integer (range 1 10))</tt></dd><dt>values</dt><dd><tt>(foobar 5)</tt></dd><dt>description</dt><dd>Integer with a minimum allowed value of 1 and maximum allowed value of 10.</dd></dl><a name='boolean'><h2>boolean</h2></a><dl><dt>protocol</dt><dd><tt>(foobar boolean)</tt></dd><dt>values</dt><dd><tt>(foobar #t)</tt></dd><dt>description</dt><dd>Boolean value.</dd></dl><a name='enumerated'><h2>enumerated</h2></a><dl><dt>protocol</dt><dd><tt>(foobar enumerated (mon tues wed thurs fri))</tt></dd><dt>values</dt><dd><tt>(foobar fri)</tt></dd><dt>description</dt><dd>List of alternative symbols.</dd></dl><a name='sequence'><h2>sequence</h2></a><dl><dt>protocol</dt><dd><tt>(foobar sequence (foo string (size 1 10)) (bar string (size 1 10)))</tt></dd><dt>values</dt><dd><tt>(foobar (foo "foo") (bar "bar"))</tt></dd><dt>description</dt><dd>Ordered sequence of types.</dd></dl><a name='sequence-of'><h2>sequence-of</h2></a><dl><dt>protocol</dt><dd><tt>(foobar sequence-of (foo string (size 1 10)) (bar string (size 1 10)))</tt></dd><dt>values</dt><dd><tt>(foobar ((foo "foo") (bar "bar")) ((foo "anotherfoo") (bar "anotherbar")))</tt></dd><dt>description</dt><dd>Ordered sequence of types where the sequence may repeat.</dd></dl><a name='set'><h2>set</h2></a><dl><dt>protocol</dt><dd><tt>(foobar set (foo string (size 1 10)) (bar string (size 1 10)))</tt></dd><dt>values</dt><dd><tt>(foobar (bar "bar") (foo "foo"))</tt></dd><dt>description</dt><dd>Unordered sequence of types. Each element of a set is also optional.</dd></dl><a name='choice'><h2>choice</h2></a><dl><dt>protocol</dt><dd><tt>(foobar choice (foo integer ()) (bar integer ()))</tt></dd><dt>values</dt><dd><tt>(foobar (bar 100))</tt></dd><dt>description</dt><dd>Single item from a series of types.</dd></dl><a name='Examples'><h1>Examples</h1></a><p>&lt;enscript highlight=scheme&gt; (require-extension packedobjects)</p><pre></pre><p>(define bbcard</p><pre> '(bbcard sequence
    2           (name string (size 1 60))
    3           (team string (size 1 60))
    4           (age integer (range 1 100))
    5           (position string (size 1 60))
    6           (handedness enumerated (left-handed right-handed ambidextrous))
    7           (batting-average sequence
    8                            (mantissa integer ())
    9                            (base enumerated (2 10))
    10                            (exponent integer ()))))
    11 </pre><p>(define bbcard-values</p><pre> '(bbcard
    12    (name "Casey")
    13    (team "Mudville Nine")
    14    (age 32)
    15    (position "left field")
    16    (handedness ambidextrous)
    17    (batting-average
    18     (mantissa 250)
    19     (base 10)
    20     (exponent -3))))
    21 </pre><p>(define po (packedobjects bbcard)) (print* "encoded in " (po 'pack bbcard-values) " bytes.\n") (print (po 'unpack)) (po 'free) &lt;/enscript&gt;</p><p>The following example retrieves random numbers from <a href='http://random.org' class='external'>random.org</a>.</p><p>The client talks to a server process which in turn obtains the numbers using HTTP. The data transferred between client and server is significantly more efficient, in terms of bits on the wire, than if the client talked directly to random.org using HTTP.</p><p><a href='http://zedstar.org/chicken/tcpclient.scm' class='external'>tcpclient.scm</a></p><p><a href='http://zedstar.org/chicken/tcpserver.scm' class='external'>tcpserver.scm</a></p><a name='Limitations'><h1>Limitations</h1></a><ul><li>The length of strings, the number of elements in a set and the number of times a sequence-of may repeat is restricted to 2^30-1.</li><li>The maximum integer (unsigned), the number of choices and the number of enumerations is restricted to 2^32-1.</li></ul><a name='To do'><h1>To do</h1></a><ul><li>Tidy code.</li><li>Performance enhancements.</li><li>Improvements to error/exception handling.</li><li>Further testing.</li></ul><a name='License'><h1>License</h1></a><p>Copyright &copy; 2006, John P. T. Moore</p><p>All rights reserved.</p><p><a href='http://www.opensource.org/licenses/bsd-license.php' class='external'>BSD license</a></p></div><div id='footer'><hr/><a href='http://www.call-with-current-continuation.org/eggs/index.html'>&lt; Egg index</a><div id='revision-history'>$Id: egg-post-commit 2255 2006-11-03 07:06:54Z felix $</div>&nbsp;</div></body></html>
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     2<!-- Generated by eggdoc Revision: 1.20  -->
     3<html>
     4<head>
     5<title>Eggs Unlimited - packedobjects</title><style type="text/css"> <!--
     6      CODE {
     7            color: #666666;
     8          }
     9/*   DT.definition EM { font-weight: bold; font-style: normal; } */
     10
     11     DT.definition {
     12                   background: #eee;
     13                   color: black;
     14                   padding: 0.2em 1em 0.2em 0.7em;
     15                   margin-left: 0.2em;
     16border: 1px solid #bbc;
     17                   font-family: "Andale Mono", monospace;
     18                   /* font-size: 1.2em; */
     19                   
     20                 }
     21     DD {
     22                   margin-top: 0.8em;
     23                   margin-bottom: 0.8em;
     24     }
     25     DIV.subsection {
     26                    border-top: 1px solid #448;
     27                    padding-left: 1em;
     28                    margin-bottom: 1.2em;
     29     }
     30     DIV.subsubsection {
     31                    border-top: 1px dotted #99c;
     32                    /* border-left: 1px solid #99c; */
     33                    padding-left: 1em;
     34                    margin-bottom: 1.2em;
     35     }
     36     DIV.subsubsubsection {
     37                    border-top: 1px solid #ddf;
     38                    padding-left: 1em;
     39                    margin-bottom: 1.2em;
     40     }
     41
     42         DIV.section {
     43                 margin-bottom: 1.5em;
     44         }
     45         a:link {
     46                 color: #336;
     47         }
     48         a:visited { color: #666; }
     49         a:active  { color: #966; }
     50         a:hover   { color: #669; }
     51         body { margin: 0; padding: 0; background: #fff; color: #000; font: 9pt "Lucida Grande", "Verdana", sans-serif; }
     52         H2 {
     53                 background: #336;
     54                 color: #fff;
     55                 padding-top: 0.5em;
     56                 padding-bottom: 0.5em;
     57                 padding-left: 16px;
     58                 margin: 0 0 1em 0;
     59        }
     60        UL LI {
     61                list-style: none;
     62        }
     63        TT {
     64                font-family: "Andale Mono", monospace;
     65                /* font-size: 1.2em; */
     66        }
     67        H3 {
     68                color: #113;
     69                margin-bottom: 0.5em;
     70        }
     71        H4, H5, H6 {
     72                color: #113;
     73                margin-bottom: 1.0em;
     74        }
     75        H5 {
     76                font-weight: normal;
     77                font-style: italic;
     78                font-size: 100%;
     79                margin-top: 1.2em;
     80        }
     81        H6 {
     82                font-weight: bold;
     83                font-size: 85%;
     84                margin-top: 1.2em;
     85        }
     86     DIV#eggheader {
     87         text-align: center;
     88                 float: right;
     89                 margin-right: 2em;
     90     }
     91     DIV#header IMG {
     92            /* display: block; margin-left: auto; margin-right: auto;  */
     93            /* float: right; */
     94            border: none;  /* firefox */
     95     }
     96     DIV#footer {
     97                background: #bbd;
     98                padding: 0.7em ;
     99                border-top: 1px solid #cce;
     100     }
     101     DIV#footer hr {
     102                display: none;
     103     }
     104     DIV#footer a {
     105                float: left;
     106     }
     107     DIV#revision-history {
     108         float: right;
     109     }
     110     
     111     DIV#body {
     112                 margin: 1em 1em 1em 16px;
     113         }
     114
     115     DIV#examples PRE {
     116       background: #eef;
     117       padding: 0.1em;
     118       border: 1px solid #aac;
     119     }
     120     PRE#license, DIV#examples PRE {
     121       padding: 0.5em;
     122     }
     123     DIV#examples PRE {
     124       /* font-size: 85%; */
     125     }
     126     PRE { font-family: "Andale Mono", monospace; }
     127     TABLE {
     128       background: #eef;
     129       padding: 0.2em;
     130       border: 1px solid #aac;
     131       border-collapse: collapse;
     132       width: 100%;
     133     }
     134     TABLE.symbol-table TD.symbol {
     135          width: 15em;
     136          font-family: "Andale Mono", monospace;
     137          /* font-size: 1.2em; */
     138     }
     139     TH {
     140       text-align: left;
     141       border-bottom: 1px solid #aac;
     142       padding: 0.25em 0.5em 0.25em 0.5em;
     143     }
     144     TD { padding: 0.25em 0.5em 0.25em 0.5em; }
     145     --></style></head>
     146<body>
     147<div id="header">
     148<h2>packedobjects</h2>
     149<div id="eggheader"><a href="index.html">
     150<img src="egg.jpg" alt="[Picture of an egg]" /></a></div></div>
     151<div id="body">
     152<div class="section">
     153<h3>Description</h3>
     154<p>packedobjects is a highly portable, cross platform, data encoding tool. The project is based on the telecommunications standard Packed Encoding Rules (PER). An abstract syntax language is used to define a protocol
     155specification. packedobjects uses the Scheme programming language to represent the protocol specification within a symbolic expression (s-expression). Using an s-expression provides a more dynamic approach over the traditional method of parsing the specification and producing high level language code. The output of applying packedobjects encoding rules to a protocol specification is a concisely encoded bit stream suitable for application domains such as network games development and mobile application development. The project has been released under the terms of the BSD license.</p>
     156<p>For a more detailed introduction refer to the following short <a href="http://zedstar.org/papers/packedobjects.pdf">paper.</a></p></div>
     157<div class="section">
     158<h3>Author</h3>John P. T. Moore</div>
     159<div class="section">
     160<h3>Version</h3>
     161<ul>
     162<li>0.66 </li>
     163<li>0.5 Alpha release</li></ul></div>
     164<div class="section">
     165<h3>Usage</h3><tt>(require-extension packedobjects)</tt></div>
     166<div class="section">
     167<h3>Download</h3><a href="packedobjects.egg">packedobjects.egg</a></div>
     168<div class="section">
     169<h3>Documentation</h3>
     170<dt class="definition"><strong>procedure:</strong> (packedobjects &lt;protocol&gt; #!key &lt;pdusize&gt; &lt;strsize&gt;)</dt>
     171<dd>
     172<p>Creates a packedobject using the supplied protocol specification. Optional values for the PDU and string buffer sizes can be specified. They default to 5000 and 1000 respectively. The PDU buffer can grow dynamically, however, the string buffer is fixed in size and therefore must handle the largest possible string. The PDU buffer must be freed manually whereas the string buffer will be automatically garabage collected.</p></dd>
     173<dt class="definition"><strong>procedure:</strong> (&lt;packedobject&gt; 'pack &lt;values&gt;)</dt>
     174<dd>
     175<p>Encodes a list of values and returns the number of bytes used.</p></dd>
     176<dt class="definition"><strong>procedure:</strong> (&lt;packedobject&gt; 'unpack)</dt>
     177<dd>
     178<p>Returns a list of values.</p></dd>
     179<dt class="definition"><strong>procedure:</strong> (&lt;packedobject&gt; 'read &lt;fd&gt; &lt;size&gt;)</dt>
     180<dd>
     181<p>Reads a number of bytes from a file descriptor into the PDU buffer.</p></dd>
     182<dt class="definition"><strong>procedure:</strong> (&lt;packedobject&gt; 'write &lt;fd&gt; &lt;size&gt;)</dt>
     183<dd>
     184<p>Writes a number of bytes from the PDU buffer to a file descriptor.</p></dd>
     185<dt class="definition"><strong>procedure:</strong> (&lt;packedobject&gt; 'dump-buffer &lt;filename&gt; &lt;size&gt;)</dt>
     186<dd>
     187<p>Dumps a number of bytes from the PDU buffer to a file.</p></dd>
     188<dt class="definition"><strong>procedure:</strong> (&lt;packedobject&gt; 'free)</dt>
     189<dd>
     190<p>Frees the PDU buffer.</p></dd></div>
     191<div class="section">
     192<h3>Data types</h3></div>
     193<p>string<table class="symbol-table">
     194<tr>
     195<td class="symbol">desc:</td>
     196<td>7 bit string limited to 10 characters in length.</td></tr>
     197<tr>
     198<td class="symbol">spec:</td>
     199<td>(foobar string (size 1 10))</td></tr>
     200<tr>
     201<td class="symbol">values:</td>
     202<td>(foobar &quot;foobar&quot;)</td></tr></table></p>
     203<p>octet-string<table class="symbol-table">
     204<tr>
     205<td class="symbol">desc:</td>
     206<td>8 bit string with no length restriction.</td></tr>
     207<tr>
     208<td class="symbol">spec:</td>
     209<td>(foobar string ())</td></tr>
     210<tr>
     211<td class="symbol">values:</td>
     212<td>(foobar &quot;foobar&quot;)</td></tr></table></p>
     213<p>bit-string<table class="symbol-table">
     214<tr>
     215<td class="symbol">desc:</td>
     216<td>Bitstring fixed in length.</td></tr>
     217<tr>
     218<td class="symbol">spec:</td>
     219<td>(foobar bit-string (size 8))</td></tr>
     220<tr>
     221<td class="symbol">values:</td>
     222<td>(foobar &quot;10101010&quot;)</td></tr></table></p>
     223<p>hex-string<table class="symbol-table">
     224<tr>
     225<td class="symbol">desc:</td>
     226<td>String of hexadecimal characters with no length restriction.</td></tr>
     227<tr>
     228<td class="symbol">spec:</td>
     229<td>(foobar hex-string (size 1 max))</td></tr>
     230<tr>
     231<td class="symbol">values:</td>
     232<td>(foobar &quot;foobar&quot;)</td></tr></table></p>
     233<p>integer<table class="symbol-table">
     234<tr>
     235<td class="symbol">desc:</td>
     236<td>Integer with a minimum allowed value of 1 and maximum allowed value of 10.</td></tr>
     237<tr>
     238<td class="symbol">spec:</td>
     239<td>(foobar integer (range 1 10))</td></tr>
     240<tr>
     241<td class="symbol">values:</td>
     242<td>(foobar 5)</td></tr></table></p>
     243<p>boolean<table class="symbol-table">
     244<tr>
     245<td class="symbol">desc:</td>
     246<td>Boolean value.</td></tr>
     247<tr>
     248<td class="symbol">spec:</td>
     249<td>(foobar boolean)</td></tr>
     250<tr>
     251<td class="symbol">values:</td>
     252<td>(foobar #t)</td></tr></table></p>
     253<p>enumerated<table class="symbol-table">
     254<tr>
     255<td class="symbol">desc:</td>
     256<td>List of alternative symbols.</td></tr>
     257<tr>
     258<td class="symbol">spec:</td>
     259<td>(foobar enumerated (mon tues wed thurs fri))</td></tr>
     260<tr>
     261<td class="symbol">values:</td>
     262<td>(foobar fri)</td></tr></table></p>
     263<p>sequence<table class="symbol-table">
     264<tr>
     265<td class="symbol">desc:</td>
     266<td>Ordered sequence of types.</td></tr>
     267<tr>
     268<td class="symbol">spec:</td>
     269<td>(foobar sequence (foo string (size 1 10)) (bar string (size 1 10)))</td></tr>
     270<tr>
     271<td class="symbol">values:</td>
     272<td>(foobar (foo &quot;foo&quot;) (bar &quot;bar&quot;))</td></tr></table></p>
     273<p>set<table class="symbol-table">
     274<tr>
     275<td class="symbol">desc:</td>
     276<td>Unordered sequence of types. Each element of a set is also optional.</td></tr>
     277<tr>
     278<td class="symbol">spec:</td>
     279<td>(foobar set (foo string (size 1 10)) (bar string (size 1 10)))</td></tr>
     280<tr>
     281<td class="symbol">values:</td>
     282<td>(foobar (bar &quot;bar&quot;) (foo &quot;foo&quot;))</td></tr></table></p>
     283<p>sequence-of<table class="symbol-table">
     284<tr>
     285<td class="symbol">desc:</td>
     286<td>Ordered sequence of types where the sequence may repeat.</td></tr>
     287<tr>
     288<td class="symbol">spec:</td>
     289<td>(foobar sequence-of (foo string (size 1 10)) (bar string (size 1 10)))</td></tr>
     290<tr>
     291<td class="symbol">values:</td>
     292<td>(foobar ((foo &quot;foo&quot;) (bar &quot;bar&quot;)) ((foo &quot;anotherfoo&quot;) (bar &quot;anotherbar&quot;)))</td></tr></table></p>
     293<p>choice<table class="symbol-table">
     294<tr>
     295<td class="symbol">desc:</td>
     296<td>Single item from a series of types.</td></tr>
     297<tr>
     298<td class="symbol">spec:</td>
     299<td>(foobar choice (foo integer ()) (bar integer ()))</td></tr>
     300<tr>
     301<td class="symbol">values:</td>
     302<td>(foobar (bar 100))</td></tr></table></p>
     303<div class="section">
     304<h3>Examples</h3>
     305<div id="examples">
     306<pre>(require-extension packedobjects)
     307 
     308(define bbcard
     309  '(bbcard sequence
     310           (name string (size 1 60))
     311           (team string (size 1 60))
     312           (age integer (range 1 100))
     313           (position string (size 1 60))
     314           (handedness enumerated (left-handed right-handed ambidextrous))
     315           (batting-average sequence
     316                            (mantissa integer ())
     317                            (base enumerated (2 10))
     318                            (exponent integer ()))))
     319 
     320(define bbcard-values
     321  '(bbcard
     322    (name &quot;Casey&quot;)
     323    (team &quot;Mudville Nine&quot;)
     324    (age 32)
     325    (position &quot;left field&quot;)
     326    (handedness ambidextrous)
     327    (batting-average
     328     (mantissa 250)
     329     (base 10)
     330     (exponent -3))))
     331 
     332(define po (packedobjects bbcard))
     333(print* &quot;encoded in &quot; (po 'pack bbcard-values) &quot; bytes.\n&quot;)
     334(print (po 'unpack))
     335(po 'free)</pre></div></div>
     336<div class="section">
     337<h3>Extended Example</h3>
     338<p>The following example retrieves random numbers from <a href="http:/random.org">random.org.</a></p>
     339<p>The client talks to a server process which in turn obtains the numbers using HTTP. The data transferred between client and server is significantly more efficient, in terms of bits on the wire, than if the client talked directly to random.org using HTTP.</p>
     340<div class="section">
     341<h3>Download</h3><a href="tcpclient.scm">tcpclient.scm</a></div>
     342<div class="section">
     343<h3>Download</h3><a href="tcpserver.scm">tcpserver.scm</a></div></div>
     344<div class="section">
     345<h3>Limits</h3>
     346<ul>
     347<li>The length of strings, the number of elements in a set and the number of times a sequence-of may repeat is restricted to 2^30-1.</li>
     348<li>The maximum integer (unsigned), the number of choices and the number of enumerations is restricted to 2^32-1.</li></ul></div>
     349<div class="section">
     350<h3>To do</h3>
     351<ul>
     352<li>Performance enhancements.</li>
     353<li>Improvements to error/exception handling.</li>
     354<li>Further testing.</li></ul></div>
     355<div class="section">
     356<h3>License</h3>
     357<pre id="license">Copyright (c) 2006, John P. T. Moore
     358All rights reserved.
     359
     360BSD license: <a href="http://www.opensource.org/licenses/bsd-license.php">http://www.opensource.org/licenses/bsd-license.php</a></pre></div></div>
     361<div id="footer">
     362<hr /><a href="index.html">&lt; Egg index</a>
     363<div id="revision-history">$Revision$ $Date$</div>&nbsp;</div></body></html>
Note: See TracChangeset for help on using the changeset viewer.