~ubuntu-branches/ubuntu/utopic/critcl/utopic

« back to all changes in this revision

Viewing changes to examples/optional/optional.tcl

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura
  • Date: 2013-05-11 00:08:06 UTC
  • Revision ID: package-import@ubuntu.com-20130511000806-7hq1zc3fnn0gat79
Tags: upstream-3.1.9
ImportĀ upstreamĀ versionĀ 3.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# optional.tcl --
 
2
#
 
3
#       A template demonstrating the handling of optional arguments
 
4
#       to cproc.
 
5
#
 
6
# Copyright (c) 2012 Andreas Kupries <andreas_kupries@users.sourceforge.net>
 
7
 
 
8
# # ## ### ##### ######## ############# #####################
 
9
## Requirements
 
10
 
 
11
package require Tcl 8.4
 
12
package require critcl 3.1.2
 
13
 
 
14
# # ## ### ##### ######## ############# #####################
 
15
## Administrivia
 
16
 
 
17
critcl::license {Andreas Kupries} BSD
 
18
 
 
19
critcl::summary {Optional arguments for cproc}
 
20
 
 
21
critcl::description {
 
22
    This package implements nothing. It serves only as a
 
23
    demonstration and template on how to declare cproc's
 
24
    with optional arguments.
 
25
}
 
26
 
 
27
critcl::subject demonstration {cproc optional arguments}
 
28
 
 
29
# # ## ### ##### ######## ############# #####################
 
30
## C code.
 
31
 
 
32
critcl::cproc fixed           {int a int b int c int d} void {}
 
33
critcl::cproc optional_head   {int {a 1} int {b 2} int c int d} void {}
 
34
critcl::cproc optional_tail   {int a int b int {c 1} int {d 2}} void {}
 
35
critcl::cproc optional_middle {int a int {b 1} int {c 2} int d} void {}
 
36
 
 
37
# ### ### ### ######### ######### #########
 
38
## Ready
 
39
package provide optional 1