source: project/wiki/eggref/4/type-stubs @ 28366

Last change on this file since 28366 was 28366, checked in by Moritz Heidkamp, 7 years ago

type-stubs: Mention compiler-typecase else constraint

File size: 2.4 KB
Line 
1== type-stubs
2
3This extension provides a module which exports stubs for Chicken's
4[[/man/4/Types|type syntax]] when used with Chicken versions below
54.7.5 which is the version this syntax was introduced with. With
6Chicken versions >= 4.7.5 it doesn't export anything. This allows code
7to be type annotated and still be excuted and compiled with older
8Chicken versions.
9
10
11=== Constraints
12
13In order to be fully compatible with older Chicken versions it is
14required to always provide an {{else}} branch in the
15{{compiler-typecase}} form. This is because pre-typed Chickens have to
16always use the {{else}} branch even when compiling code.
17
18
19=== Example
20
21<enscript language="scheme">
22(module my-typed-module
23
24(doubled-number->string)
25
26(import chicken scheme type-stubs)
27
28(: doubled-number->string (number -> string))
29(define (doubled-number->string n)
30  (number->string (* n n)))
31
32)
33</enscript>
34
35=== License
36
37  Copyright (c) 2013, Moritz Heidkamp
38  All rights reserved.
39 
40  Redistribution and use in source and binary forms, with or without
41  modification, are permitted provided that the following conditions are
42  met:
43 
44  Redistributions of source code must retain the above copyright
45  notice, this list of conditions and the following disclaimer.
46 
47  Redistributions in binary form must reproduce the above copyright
48  notice, this list of conditions and the following disclaimer in the
49  documentation and/or other materials provided with the distribution.
50 
51  Neither the name of the author nor the names of its contributors may
52  be used to endorse or promote products derived from this software
53  without specific prior written permission.
54 
55  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
56  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
57  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
58  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
59  COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
60  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
61  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
62  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66  OF THE POSSIBILITY OF SUCH DAMAGE.
67
Note: See TracBrowser for help on using the repository browser.