ycl

Check-in [c1a50d2002]
Login

Check-in [c1a50d2002]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:move [package provide] lines into pkgIndex.Tcl
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c1a50d20029f1ffb0c7655ca1fb779ce5948c29c
User & Date: pooryorick 2012-09-19 00:09:19.569
Context
2012-09-19
02:12
standardize test methodology check-in: 9441f34b38 user: pooryorick tags: trunk
00:09
move [package provide] lines into pkgIndex.Tcl check-in: c1a50d2002 user: pooryorick tags: trunk
2012-09-18
12:08
(no comment) check-in: 9dbc824940 user: pooryorick tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to asa/lib/X3.4-1963.test.
1
2
3

4

5
#! /bin/env tclsh
#! /bin/env tclsh


package require ycl::ansi::X3.4-1963::test

ycl::ansi::X3.4-1963::test::suite_main



>

>
|
1
2
3
4
5
6
7
#! /bin/env tclsh
#! /bin/env tclsh

set ::YCL(IMPORTPREFIX) goon
package require ycl::ansi::X3.4-1963::test
puts [namespace children goon]
goon::ansi::X3.4-1963::test::suite_main
Changes to asa/lib/X3.4-1963.test.tcl.
1
2

3
4
5
6
7
8
9
#! /bin/env tclsh


proc suite_main {} {
	package require tcltest
	eval ::tcltest::configure $::argv

	package require ycl::context 
	namespace import ::tcltest::*
	test test1 {basic test} -body {


>







1
2
3
4
5
6
7
8
9
10
#! /bin/env tclsh

puts "hibble [namespace current]"
proc suite_main {} {
	package require tcltest
	eval ::tcltest::configure $::argv

	package require ycl::context 
	namespace import ::tcltest::*
	test test1 {basic test} -body {
Changes to asa/pkgIndex.tcl.


1
2
3
4
5
6
7


package ifneeded ycl::ansi::X3.4-1963 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source ansi::X3.4-1963 \
		 [file join $dir lib X3.4-1963.tcl] 
	package provide ycl::ansi::X3.4-1963 0.1
}} $dir]

>
>







1
2
3
4
5
6
7
8
9
#! /bin/env tclsh

package ifneeded ycl::ansi::X3.4-1963 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source ansi::X3.4-1963 \
		 [file join $dir lib X3.4-1963.tcl] 
	package provide ycl::ansi::X3.4-1963 0.1
}} $dir]

Changes to context/lib/aclcontext.example.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/env tclsh

set mypath [file dirname [file normalize [file join [info script] __dummy__]]]
set mydir [file dirname $mypath]
set myprefix [file dirname $mydir]
set libdir [file join $myprefix lib]
set auto_path [linsert $auto_path[set auto_path {}] 0 $libdir]
set auto_path [linsert $auto_path[set auto_path {}] 0 $mydir]

package require nsprefix
package require ycl::aclcontext 0.1

namespace import ycl::aclcontext::context

context obj1
obj1 $ greeting hello
obj1 acl var greeting [list read write]









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/env tclsh

set mypath [file dirname [file normalize [file join [info script] __dummy__]]]
set mydir [file dirname $mypath]
set myprefix [file dirname $mydir]
set libdir [file join $myprefix lib]
set auto_path [linsert $auto_path[set auto_path {}] 0 $libdir]
set auto_path [linsert $auto_path[set auto_path {}] 0 $mydir]

package require ycl
package require ycl::aclcontext 0.1

namespace import ycl::aclcontext::context

context obj1
obj1 $ greeting hello
obj1 acl var greeting [list read write]
Changes to context/lib/aclcontext.tcl.
1
2
3
4
5
6
7
8
9
10
11
#! /bin/env tclsh

package require ycl::nsprefix

package require ycl 0.1
package require ycl::context 
variable context ${::YCL(IMPORTPREFIX)}::context
package require ycl::ns
variable ns ${::YCL(IMPORTPREFIX)}::ns
package require ycl::list
variable list ${::YCL(IMPORTPREFIX)}::list


<
<







1
2


3
4
5
6
7
8
9
#! /bin/env tclsh



package require ycl 0.1
package require ycl::context 
variable context ${::YCL(IMPORTPREFIX)}::context
package require ycl::ns
variable ns ${::YCL(IMPORTPREFIX)}::ns
package require ycl::list
variable list ${::YCL(IMPORTPREFIX)}::list
Changes to context/lib/configure.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
#! /bin/env tclsh

package require ycl::nsprefix

package require ycl 0.1
package require ycl::ns
variable ns ${::YCL(IMPORTPREFIX)}::ns

package require ycl::context::etc
variable etc ${::YCL(IMPORTPREFIX)}::context::etc

namespace export \[a-z\]*


|
<
<







1
2
3


4
5
6
7
8
9
10
#! /bin/env tclsh

package require ycl


package require ycl::ns
variable ns ${::YCL(IMPORTPREFIX)}::ns

package require ycl::context::etc
variable etc ${::YCL(IMPORTPREFIX)}::context::etc

namespace export \[a-z\]*
Changes to context/lib/context.example.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/env tclsh

set mypath [file dirname [file normalize [file join [info script] __dummy__]]]
set mydir [file dirname $mypath]
set myprefix [file dirname $mydir]
set libdir [file join $myprefix lib]
set auto_path [linsert $auto_path[set auto_path {}] 0 $libdir]
set auto_path [linsert $auto_path[set auto_path {}] 0 $mydir]

package require nsprefix
::YCL(IMPORTPREFIX) [namespace current]::flubgubber

package require ycl::context

namespace import [::YCL(IMPORTPREFIX)]::ycl::context::*

proc fly {ns args} {









<







1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
#! /bin/env tclsh

set mypath [file dirname [file normalize [file join [info script] __dummy__]]]
set mydir [file dirname $mypath]
set myprefix [file dirname $mydir]
set libdir [file join $myprefix lib]
set auto_path [linsert $auto_path[set auto_path {}] 0 $libdir]
set auto_path [linsert $auto_path[set auto_path {}] 0 $mydir]


::YCL(IMPORTPREFIX) [namespace current]::flubgubber

package require ycl::context

namespace import [::YCL(IMPORTPREFIX)]::ycl::context::*

proc fly {ns args} {
Changes to context/lib/context.tcl.
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
	To change the context of a layer:

		animal3 update animal1 context


}

package require ycl::nsprefix
package require ycl::context::etc
variable etc ${::YCL(IMPORTPREFIX)}::context::etc

interp alias {} [namespace current] {} [namespace current]::context
#the name of the meta-layer of each layer
namespace upvar $etc META META
namespace upvar $etc BLOCK BLOCK







<







256
257
258
259
260
261
262

263
264
265
266
267
268
269
	To change the context of a layer:

		animal3 update animal1 context


}


package require ycl::context::etc
variable etc ${::YCL(IMPORTPREFIX)}::context::etc

interp alias {} [namespace current] {} [namespace current]::context
#the name of the meta-layer of each layer
namespace upvar $etc META META
namespace upvar $etc BLOCK BLOCK
Changes to context/lib/contextConfigureDefault.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
#! /bin/env tclsh

package require ycl::nsprefix

package require ycl 0.1
package require ycl::context::etc
variable etc ${::YCL(IMPORTPREFIX)}::context::etc

namespace upvar $etc META META
namespace upvar $etc VAR_DEFAULT VAR_DEFAULT

package require ycl::list


|
<
<







1
2
3


4
5
6
7
8
9
10
#! /bin/env tclsh

package require ycl


package require ycl::context::etc
variable etc ${::YCL(IMPORTPREFIX)}::context::etc

namespace upvar $etc META META
namespace upvar $etc VAR_DEFAULT VAR_DEFAULT

package require ycl::list
Changes to context/lib/contextConfigureDefaultVar.tcl.
1
2
3
4
5
6
7
8
#! /bin/env tclsh

package require ycl::nsprefix

package require ycl 0.1
namespace ensemble create

return ${::YCL(IMPORTPREFIX)}::context::configure::default::var


<
<




1
2


3
4
5
6
#! /bin/env tclsh



package require ycl 0.1
namespace ensemble create

return ${::YCL(IMPORTPREFIX)}::context::configure::default::var
Changes to context/lib/contextConfigureVar.tcl.
1
2
3
4
5
6
7
8
9
#! /bin/env tclsh

package require ycl::nsprefix

package require ycl 0.1
namespace ensemble create

package provide ycl::context::configure::default::var
return ${::YCL(IMPORTPREFIX)}::context::configure::default::var


<
<





1
2


3
4
5
6
7
#! /bin/env tclsh



package require ycl 0.1
namespace ensemble create

package provide ycl::context::configure::default::var
return ${::YCL(IMPORTPREFIX)}::context::configure::default::var
Changes to context/lib/info.tcl.
1
2
3
4
5
6
7
8
9
10
11
#! /bin/env tclsh

package require ycl::nsprefix
package require ycl 0.1
package require ycl::context::etc
variable etc ${::YCL(IMPORTPREFIX)}::context::etc
namespace upvar $etc META META
namespace upvar $etc BLOCK BLOCK
namespace upvar $etc RETURN RETURN
namespace upvar $etc INFO_VAR_BLOCKED INFO_VAR_BLOCKED
namespace upvar $etc INFO_VAR_NAME INFO_VAR_NAME


|
<







1
2
3

4
5
6
7
8
9
10
#! /bin/env tclsh

package require ycl

package require ycl::context::etc
variable etc ${::YCL(IMPORTPREFIX)}::context::etc
namespace upvar $etc META META
namespace upvar $etc BLOCK BLOCK
namespace upvar $etc RETURN RETURN
namespace upvar $etc INFO_VAR_BLOCKED INFO_VAR_BLOCKED
namespace upvar $etc INFO_VAR_NAME INFO_VAR_NAME
Changes to convert/bin/UsaaStatementToCsv.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/env tclsh

#input: a text stream produced by "pdftotext"

package require csv

package require ycl::nsprefix

set mydir [file normalize [file dirname [info script]]]
package require ycl::yparse
variable yparse ${::YCL(IMPORTPREFIX)}::yparse
package require ycl::yparse::parser
variable parser ${::YCL(IMPORTPREFIX)}::yparser::parser
package require ycl::yparse::parser::UsaaStatement
variable UsaaStatement ${::YCL(IMPORTPREFIX)}::yparse::parser::UsaaStatement






<
<







1
2
3
4
5
6


7
8
9
10
11
12
13
#! /bin/env tclsh

#input: a text stream produced by "pdftotext"

package require csv



set mydir [file normalize [file dirname [info script]]]
package require ycl::yparse
variable yparse ${::YCL(IMPORTPREFIX)}::yparse
package require ycl::yparse::parser
variable parser ${::YCL(IMPORTPREFIX)}::yparser::parser
package require ycl::yparse::parser::UsaaStatement
variable UsaaStatement ${::YCL(IMPORTPREFIX)}::yparse::parser::UsaaStatement
Changes to dict/pkgIndex.tcl.
1
2
3
4
5
6
#! /bin/env tclsh

package ifneeded ycl::dict 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source dict [file join $dir lib dict.tcl] 
    }} $dir]





|
1
2
3
4
5
6
#! /bin/env tclsh

package ifneeded ycl::dict 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source dict [file join $dir lib dict.tcl] 
}} $dir]
Changes to doc/pkgIndex.tcl.
1
2
3





#! /bin/env tclsh

package ifneeded ycl::doc 0.1 [list source [file join $dir lib doc.tcl]]







|
>
>
>
>
>
1
2
3
4
5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::doc 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source doc \
		 [file join $dir lib doc.tcl] 
	package provide ycl::doc 0.1
}} $dir]
Changes to exec/lib/exec.tcl.
109
110
111
112
113
114
115
116
117
118
				set status $estatus
			}
		}
	}
	exit $status
}



package provide ycl::exec 0.1







<
<
<
109
110
111
112
113
114
115



				set status $estatus
			}
		}
	}
	exit $status
}




Changes to exec/pkgIndex.tcl.
1
2
3
4
5


6

7
#! /bin/env tclsh

package ifneeded ycl::exec 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source exec [file join $dir lib exec.tcl] 


    }} $dir]






|
>
>
|
>

1
2
3
4
5
6
7
8
9
10
#! /bin/env tclsh

package ifneeded ycl::exec 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source exec \
		 [file join $dir lib exec.tcl] 
	package provide ycl::exec 0.1
}} $dir]


Changes to expect/lib/expect.tcl.
14
15
16
17
18
19
20
21
	variable breaks
	send "delete "
	send $breaks($item)
	send \r
	unset breaks($item)
}

package provide ycl::expect 0.1







<
14
15
16
17
18
19
20

	variable breaks
	send "delete "
	send $breaks($item)
	send \r
	unset breaks($item)
}


Changes to expect/lib/gdb.tcl.
1
2
3
4
5
#! /bin/env tclsh expect

variable prompt  "\n(gdb) "

package provide ycl::expect::gdb 0.1




<
1
2
3
4

#! /bin/env tclsh expect

variable prompt  "\n(gdb) "


Changes to expect/lib/r.tcl.
1
2
3
4
5
#! /bin/env tclsh

set prompt {\n>\s*}

package provide ycl::expect::r 0.1




<
1
2
3
4

#! /bin/env tclsh

set prompt {\n>\s*}


Changes to expect/pkgIndex.tcl.
1
2
3
4
5


6
7
8
9
10

11
12
13
14
15

16
#! /bin/env tclsh

package ifneeded ycl::expect 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source expect [file join $dir lib expect.tcl] 


    }} $dir]

package ifneeded ycl::expect::gdb 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source expect::gdb [file join $dir lib gdb.tcl] 

    }} $dir]

package ifneeded ycl::expect::r 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source expect::r [file join $dir lib r.tcl] 

    }} $dir]




|
>
>
|




>
|




>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/env tclsh

package ifneeded ycl::expect 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source expect \
		[file join $dir lib expect.tcl] 
	package provide ycl::expect 0.1
}} $dir]

package ifneeded ycl::expect::gdb 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source expect::gdb [file join $dir lib gdb.tcl] 
	package provide ycl::expect::gdb 0.1
}} $dir]

package ifneeded ycl::expect::r 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source expect::r [file join $dir lib r.tcl] 
	package provide ycl::expect::r 0.1
}} $dir]
Changes to feeder/lib/feeder.tcl.
1
2
3
4
5
#! /bin/env tclsh

package require ycl::nsprefix

package provide ycl::feeder 0.1


<
<
<
1
2



#! /bin/env tclsh




Changes to feeder/lib/linefeeder.tcl.
45
46
47
48
49
50
51
52

proc go self {
	global vwait
	fileevent [set ${self}::fh] readable [list ${self} feed]
	vwait vwait
}

package provide ycl::feeder::linefeeder 0.1







<
45
46
47
48
49
50
51


proc go self {
	global vwait
	fileevent [set ${self}::fh] readable [list ${self} feed]
	vwait vwait
}


Changes to feeder/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
16

17
#! /bin/env tclsh

package ifneeded ycl::feeder 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::feeder [list  \
			source [file join $dir lib feeder.tcl]] 

	}} $dir]

package ifneeded ycl::feeder::linefeeder 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::feeder::linefeeder [list  \
			source [file join $dir lib linefeeder.tcl]] 

	}} $dir]



<
|
<
|
|
>
|


<
|
<
|
|
>
|
1
2
3

4

5
6
7
8
9
10

11

12
13
14
15
#! /bin/env tclsh

package ifneeded ycl::feeder 0.1 [list apply {{dir} {

	package require ycl::package

	${::YCL(IMPORTPREFIX)}::package::source feeder \
	    [file join $dir lib feeder.tcl] 
	package provide ycl::feeder 0.1
}} $dir]

package ifneeded ycl::feeder::linefeeder 0.1 [list apply {{dir} {

	package require ycl::package

	${::YCL(IMPORTPREFIX)}::package::source linefeeder \
	    [file join $dir lib linefeeder.tcl] 
	package provide ycl::feeder::linefeeder 0.1
}} $dir]
Changes to file/lib/file.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/env tclsh

package require nsprefix

namespace eval [::YCL(IMPORTPREFIX)]ycl::file {
	package require ycl 0.1
	variable ns ycl::file

}

package provide ycl::file 0.1
return [::YCL(IMPORTPREFIX)]ycl::file



<
<
<
<
<
<
<
<
<


1
2









3
4
#! /bin/env tclsh










return [::YCL(IMPORTPREFIX)]ycl::file

Changes to file/pkgIndex.tcl.
1
2
3





#! /bin/env tclsh

package ifneeded ycl::file 0.1 [list source [file join $dir lib file.tcl]]







|
>
>
>
>
>
1
2
3
4
5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::file 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source file \
		 [file join $dir lib file.tcl] 
	package provide ycl::file 0.1
}} $dir]
Changes to format/pkgIndex.tcl.
1
2
3
4
5

6
7
#! /bin/env tclsh

package ifneeded ycl::format 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source format [file join $dir lib format.tcl] 

    }} $dir]





|
>
|

1
2
3
4
5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::format 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source format \
		[file join $dir lib format.tcl] 
}} $dir]

Changes to fs/lib/symlink.tcl.
25
26
27
28
29
30
31
32
		}
		lappend seen $next
		set next [file readlink $next]
	}
	return 0
}

package provide ycl::fs::symlink 0.1







<
25
26
27
28
29
30
31

		}
		lappend seen $next
		set next [file readlink $next]
	}
	return 0
}


Changes to fs/pkgIndex.tcl.
1
2
3
4
5

6
7
8
9
10


11
#! /bin/env tclsh

package ifneeded ycl::fs 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source fs [file join $dir lib http.tcl] 

    }} $dir]

package ifneeded ycl::fs::symlink 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source fs::symlink [file join $dir lib http.tcl] 


    }} $dir]





>
|



|
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /bin/env tclsh

package ifneeded ycl::fs 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source fs [file join $dir lib http.tcl] 
	package provide ycl::fs 0.1
}} $dir]

package ifneeded ycl::fs::symlink 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source fs::symlink \
		[file join $dir lib http.tcl] 
	package provide ycl::fs::symlink 0.1
}} $dir]
Changes to gryp/lib/cmdWalk.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/env tclsh

package require nsprefix

namespace eval [::YCL(IMPORTPREFIX)]ycl::gryp::walk {
	proc walk {args} {
		set config [context]
		set formal [list -start]
		dict with args {
		}
	}

	proc walkOptStart+ {config key val} {
		if {![file isdirectory $val]} {
			return -code error "config: walk: no such directory: $val"
		} else {
			$config set walkDir val 
		}
	}
}


<
<
<
|
|
|
|
|
|

|
|
|
|
|
<


1
2



3
4
5
6
7
8
9
10
11
12
13
14

15
16
#! /bin/env tclsh




proc walk {args} {
	set config [context]
	set formal [list -start]
	dict with args {
	}
}

proc walkOptStart+ {config key val} {
	if {![file isdirectory $val]} {
		return -code error "config: walk: no such directory: $val"
	} else {
		$config set walkDir val 

	}
}
Changes to gryp/lib/config.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/env tclsh

package require nsprefix

namespace eval [::YCL(IMPORTPREFIX)]ycl::gryp::config {

	package require ycl::gryp
	package require ycl::context 0.1
	package require ycl::ns 0.1

	namespace import [::YCL(IMPORTPREFIX)]ycl::ns::upcmd

	namespace export cfg defaults new opts

	variable META meta
	variable REPO repo

	proc new {id} {
		set id [[::YCL(IMPORTPREFIX)]ycl::ns::nsnormalize [uplevel 1 namespace current] $id]
		::ycl::context::context $id
		$id method meta meta+
		$id method repo repo+
		$id method setDefaults setDefaults+
		$id setDefaults
		return $id
	}

	proc meta+ {id args} {
		variable META
		set argl [llength $args]
		if {$argl == 0} {
			return [set ${id}::$META]
		} elseif {$argl == 1} {
			return [set ${id}::$META [lindex $args 0]]
		} else {
			return -code error "wrong # of args"
		}
	}

	proc repo+ {id args} {
		variable REPO
		set argl [llength $args]
		variable REPO
		if {$argl == 0} {
			return [set ${id}::$REPO]
		} elseif {$argl == 1} {
			return [set ${id}::$REPO [lindex $args 0]]
		} else {
			return -code error "wrong # of args"
		}
	}

	proc setDefaults+ {id args} {
		$id repo ~/var/gryp/repo
		$id meta ~/var/gryp/meta
	}

	proc cfg {id} {
		namespace eval $id {
			return $cfg
		}
	}

	upcmd
	namespace ensemble create
}

package provide ycl::gryp::config 0.1


<
<
<
<
|
|
|

|

|

|
|

|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|

|
|
|
|
|

|
|
<
<
<
1
2




3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61



#! /bin/env tclsh





package require ycl::gryp
package require ycl::context 0.1
package require ycl::ns 0.1

namespace import [::YCL(IMPORTPREFIX)]ycl::ns::upcmd

namespace export cfg defaults new opts

variable META meta
variable REPO repo

proc new {id} {
	set id [[::YCL(IMPORTPREFIX)]ycl::ns::nsnormalize [uplevel 1 namespace current] $id]
	::ycl::context::context $id
	$id method meta meta+
	$id method repo repo+
	$id method setDefaults setDefaults+
	$id setDefaults
	return $id
}

proc meta+ {id args} {
	variable META
	set argl [llength $args]
	if {$argl == 0} {
		return [set ${id}::$META]
	} elseif {$argl == 1} {
		return [set ${id}::$META [lindex $args 0]]
	} else {
		return -code error "wrong # of args"
	}
}

proc repo+ {id args} {
	variable REPO
	set argl [llength $args]
	variable REPO
	if {$argl == 0} {
		return [set ${id}::$REPO]
	} elseif {$argl == 1} {
		return [set ${id}::$REPO [lindex $args 0]]
	} else {
		return -code error "wrong # of args"
	}
}

proc setDefaults+ {id args} {
	$id repo ~/var/gryp/repo
	$id meta ~/var/gryp/meta
}

proc cfg {id} {
	namespace eval $id {
		return $cfg
	}
}

upcmd
namespace ensemble create



Changes to gryp/lib/gryp.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /bin/env tclsh

package require nsprefix
package require ycl::ns

namespace eval [::YCL(IMPORTPREFIX)]ycl::gryp {
	namespace import [::YCL(IMPORTPREFIX)]ycl::ns::upcmd
	upcmd
	namespace ensemble create
}

package provide ycl::gryp 0.1
return [::YCL(IMPORTPREFIX)]ycl::gryp



<


<
|
|
|
|
<
<


1
2

3
4

5
6
7
8


9
10
#! /bin/env tclsh


package require ycl::ns


namespace import [::YCL(IMPORTPREFIX)]ycl::ns::upcmd
upcmd
namespace ensemble create



return [::YCL(IMPORTPREFIX)]ycl::gryp

Changes to gryp/lib/opts.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/env tclsh

package require nsprefix
package require ycl::ns

package require ycl::gryp

namespace eval [::YCL(IMPORTPREFIX)]ycl::gryp::opts {
	proc start {ctxt} {
		return [list \
			[list $ctxt optConf] \
			[list $ctxt optRepo] \
			[list $ctxt optArgstart] \
		]
	}

	proc optConf {ctxt val} {
		set match 0
		set states [list]
		if {string match -conf} {
			set match 1
			$myconfig conf $arg
		}
		return [list $match $states]
	}

	proc optConf {ctxt val} {
		set match 0
		set states [list]
		if {string match -conf} {
			set match 1
			$myconfig repo $arg
		}
		return [list $match $states]
	}

	proc optArgstart {ctxt val} {
		set match 0
		set states [list]
		if {string match -conf} {
			set match 1
			lappend $states [list $ctxt $optArgs]
		}
		return [list $match $states]
	}

	proc optArgs {ctxt val} {
		set match 1
		set states [list]
		lappend $states [list $ctxt $optArgs]
		return [list $match $states]
	}


	[::YCL(IMPORTPREFIX)]ycl::ns::upcmd [namespace current]::opts
}


package provide ycl::gryp::opts 0.1



<

<


<
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|

|
|
|
|
|
|


|
<
<
<
<
<
1
2

3

4
5

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52





#! /bin/env tclsh


package require ycl::ns

package require ycl::gryp


proc start {ctxt} {
	return [list \
		[list $ctxt optConf] \
		[list $ctxt optRepo] \
		[list $ctxt optArgstart] \
	]
}

proc optConf {ctxt val} {
	set match 0
	set states [list]
	if {string match -conf} {
		set match 1
		$myconfig conf $arg
	}
	return [list $match $states]
}

proc optConf {ctxt val} {
	set match 0
	set states [list]
	if {string match -conf} {
		set match 1
		$myconfig repo $arg
	}
	return [list $match $states]
}

proc optArgstart {ctxt val} {
	set match 0
	set states [list]
	if {string match -conf} {
		set match 1
		lappend $states [list $ctxt $optArgs]
	}
	return [list $match $states]
}

proc optArgs {ctxt val} {
	set match 1
	set states [list]
	lappend $states [list $ctxt $optArgs]
	return [list $match $states]
}


[::YCL(IMPORTPREFIX)]ycl::ns::upcmd [namespace current]::opts





Deleted gryp/lib/pkgIndex.tcl.
1
2
3
4
package ifneeded ycl::gryp 0.1 [list source [file join $dir gryp.tcl]]
package ifneeded ycl::gryp::config 0.1 [list source [file join $dir config.tcl]]
package ifneeded ycl::gryp::cmdline 0.1 [list source [file join $dir cmdline.tcl]]
package ifneeded ycl::gryp::opts 0.1 [list source [file join $dir opts.tcl]]
<
<
<
<








Changes to help/pkgIndex.tcl.
1
2
3
4
5

6
7
#! /bin/env tclsh

package ifneeded ycl::help 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source help [file join $dir lib help.tcl] 

    }} $dir]






>
|

1
2
3
4
5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::help 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source help [file join $dir lib help.tcl] 
	package provide ycl::help 0.1
}} $dir]

Changes to http/lib/http.tcl.
24
25
26
27
28
29
30
31

proc head_send {conn key args} {
}

proc head_end {} {
}

package provide ycl::http 0.1







<
24
25
26
27
28
29
30


proc head_send {conn key args} {
}

proc head_end {} {
}


Changes to http/pkgIndex.tcl.
1
2
3
4
5

6
7
#! /bin/env tclsh

package ifneeded ycl::http 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source http [file join $dir lib http.tcl] 

    }} $dir]






>
|

1
2
3
4
5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::http 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source http [file join $dir lib http.tcl] 
	package provide ycl::http 0.1
}} $dir]

Changes to import/lib/import.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/env tclsh

package require ycl 0.1
package require ycl::nsprefix


variable modpath [list] 

proc import {name req in} {
	set loc  [find $name $req]
	import $loc $in
}




<
<
<







1
2
3



4
5
6
7
8
9
10
#! /bin/env tclsh

package require ycl 0.1



variable modpath [list] 

proc import {name req in} {
	set loc  [find $name $req]
	import $loc $in
}

24
25
26
27
28
29
30
31
		set in "${callingspace}::$in"
	}

	namespace eval $in [list set namespace $in]
	return [namespace eval $in [list source $what]]
}

package provide ycl::import 0.1







<
21
22
23
24
25
26
27

		set in "${callingspace}::$in"
	}

	namespace eval $in [list set namespace $in]
	return [namespace eval $in [list source $what]]
}


Changes to import/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
#! /bin/env tclsh

package ifneeded ycl::import 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::import [list  \
			source [file join $dir lib import.tcl]] 

	}} $dir]



<
|
<
|
|
>
|
1
2
3

4

5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::import 0.1 [list apply {{dir} {

	package require ycl::package

	${::YCL(IMPORTPREFIX)}::package::source import \
		 [file join $dir lib import.tcl] 
	package provide ycl::import 0.1
}} $dir]
Changes to list/lib/list.tcl.
12
13
14
15
16
17
18
19
20
		if {$idx < [llength $list]} {
			return [lindex $list $idx]
		}
		return -code error "$idx is greater than last index!" 
	}
}

package provide ycl::list 0.1
return ${::YCL(IMPORTPREFIX)}::list







<

12
13
14
15
16
17
18

19
		if {$idx < [llength $list]} {
			return [lindex $list $idx]
		}
		return -code error "$idx is greater than last index!" 
	}
}


return ${::YCL(IMPORTPREFIX)}::list
Changes to list/pkgIndex.tcl.
1
2
3
4
5


6
#! /bin/env tclsh

package ifneeded ycl::list 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source list [file join $dir lib list.tcl] 


    }} $dir]




|
>
>
|
1
2
3
4
5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::list 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source list \
		[file join $dir lib list.tcl] 
	package provide ycl::list 0.1
}} $dir]
Changes to ns/lib/ns.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
#! /bin/env tclsh

package require ycl::nsprefix

package require ycl 0.1
package require ycl::proc

variable proc ${::YCL(IMPORTPREFIX)}::proc

variable UNIQUE_IN #
variable Id 0



<
<
<







1
2



3
4
5
6
7
8
9
#! /bin/env tclsh




package require ycl::proc

variable proc ${::YCL(IMPORTPREFIX)}::proc

variable UNIQUE_IN #
variable Id 0

122
123
124
125
126
127
128
129
130
	if [string match $in {}] { set in $UNIQUE_IN }
	set id ${prefix}::${in}::[incr Id]
}

namespace export {[a-z]*}
namespace ensemble create

package provide ycl::ns 0.1
return ${::YCL(IMPORTPREFIX)}::ns







<

119
120
121
122
123
124
125

126
	if [string match $in {}] { set in $UNIQUE_IN }
	set id ${prefix}::${in}::[incr Id]
}

namespace export {[a-z]*}
namespace ensemble create


return ${::YCL(IMPORTPREFIX)}::ns
Changes to ns/pkgIndex.tcl.
1
2
3
4
5

6
#! /bin/env tclsh

package ifneeded ycl::ns 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source ns [file join $dir lib ns.tcl] 

    }} $dir]





>
|
1
2
3
4
5
6
7
#! /bin/env tclsh

package ifneeded ycl::ns 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source ns [file join $dir lib ns.tcl] 
	package provide ycl::ns 0.1
}} $dir]
Changes to nsprefix/lib/nsprefix.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/env tclsh

proc YCL_NSPREFIX {args} {
	global env
	global YCL
	set argl [llength $args]
	if {$argl == 0 } {
		if {![info exists YCL(IMPORTPREFIX)]} {
			if [info exists env(YCL(IMPORTPREFIX))] {
				set YCL(IMPORTPREFIX) $env(YCL(IMPORTPREFIX))
			} else {
				set YCL(IMPORTPREFIX) ::
			}
		}

		if {![string match {*::} $YCL(IMPORTPREFIX)]} {
				set YCL(IMPORTPREFIX) ${YCL(IMPORTPREFIX)}::
		}
	} elseif {$argl == 1} {
		set name [lindex $args 0]
		if {![string match ::* $name]} {
			return -code error "name must be absolute: $name"
		}
		set YCL(IMPORTPREFIX) $name
	} else {
		return -code error "wrong # of args.  Should be 0 or 1" 
	}
	return $YCL(IMPORTPREFIX)
}

package provide ycl::nsprefix 0.1



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
1
2






























#! /bin/env tclsh































Changes to nsprefix/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
#! /bin/env tclsh

package ifneeded ycl::nsprefix 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::nsprefix [list  \
			source [file join $dir lib nsprefix.tcl]] 

	}} $dir ]



<
|
<
|
|
>
|
1
2
3

4

5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::nsprefix 0.1 [list apply {{dir} {

	package require ycl

	namespace eval ${::YCL(IMPORTPREFIX)}::nsprefix [list  \
		source [file join $dir lib nsprefix.tcl]] 
	package provide ycl::nsprefix 0.1
}} $dir ]
Changes to package/lib/package.tcl.
1
2

3
4
5
6
7
8
9
10
11
#! /bin/env tclsh


proc require {name args} {
	set ::YCL(IMPORT_PREFIX) [uplevel namespace current]
	rename ::package [namespace current]::package_orig
	namespace eval :: {
		interp alias {} ::package {} ycl::package
	}
	package_orig require $name {*}$args
	interp alias {} ::package {} {}
	rename [namespace current]::package_orig ::package


>

|







1
2
3
4
5
6
7
8
9
10
11
12
#! /bin/env tclsh


proc require {name args} {
	yclprefix [uplevel namespace current]
	rename ::package [namespace current]::package_orig
	namespace eval :: {
		interp alias {} ::package {} ycl::package
	}
	package_orig require $name {*}$args
	interp alias {} ::package {} {}
	rename [namespace current]::package_orig ::package
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43

44
45
46
47
48

if 0 {
#an example of how it used to be done in a pkgIndex.tcl file
package ifneeded ycl::rfc 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::rfc [list  \
			source [file join $dir lib rfc.tcl]] 
	}} $dir]
}

proc source {name file} {
    if {![info exists ::YCL(IMPORTPREFIX)]} {
	    set ::YCL(IMPORTPREFIX) ::ycl
    }

    namespace eval ${::YCL(IMPORTPREFIX)}::$name [list source $file]
}



namespace export {[a-z]*} 
namespace ensemble create

package provide ycl::package 0.1







|
|







>
|
<
|
>




<
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
47
48
49


if 0 {
#an example of how it used to be done in a pkgIndex.tcl file
package ifneeded ycl::rfc 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval :: [list namespace eval ${::YCL(IMPORTPREFIX)}::rfc \
			[list source [file join $dir lib rfc.tcl]]] 
	}} $dir]
}

proc source {name file} {
    if {![info exists ::YCL(IMPORTPREFIX)]} {
	    set ::YCL(IMPORTPREFIX) ::ycl
    }
	namespace eval :: [list \
		namespace eval ${::YCL(IMPORTPREFIX)}::$name [list source $file]

	]
}

namespace export {[a-z]*} 
namespace ensemble create


Changes to package/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
#! /bin/env tclsh

package ifneeded ycl::package 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::package [list  \
			source [file join $dir lib package.tcl]] 

	}} $dir]



<
|
<
|
|
>
|
1
2
3

4

5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::package 0.1 [list apply {{dir} {

	package require ycl

	namespace eval [yclprefix]::package [list  \
		source [file join $dir lib package.tcl]] 
	package provide ycl::package 0.1
}} $dir]
Changes to parser/lib/parser.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /bin/env tclsh

package require nsprefix

namespace eval [::YCL(IMPORTPREFIX)]ycl::parser {

	package require ycl 0.1
	package require ycl::context
	variable context [::YCL(IMPORTPREFIX)]ycl::context

	package require ycl::ns
	variable ns [::YCL(IMPORTPREFIX)]ycl::ns

	namespace export {[a-z]*}

	proc new {} {
		variable context
		set res [$context]
		$res var FAIL 0
		$res var ACCEPT 1
		$res method parse
		return $res
	}

	proc parse {ctxt words_ newstates_} {
		variable ns
		upvar $words_ words
		upvar $newstates_ newstates
		foreach newstate $newstates {
			set normalized  [lindex $newstate 0] 
			set normalized  [uplevel [list ${ns}::nsnormalize] {[namespace current]} $normalized]
			lappend states [lreplace $newstate 0 0 $normalized]
		}

		set i -1 
		foreach word $words {
			incr i
			if {![llength $states]} {
				return $i
			}
			set newstates_total [list]
			set accept_total 0
			foreach state $states {	
				lassign [{*}$state $word] accepted newstates
				incr accept_total $accepted
				foreach newstate $newstates {
					#each state should only appear once in the list
					if {$newstate ni $newstates_total} {
						lappend newstates_total $newstate
					}
				}
			}
			if {$accept_total} {
				set states $newstates_total
			} else {
				return $i 
			}
		}
	}

	namespace ensemble create
}

package provide ycl::parser 0.1


<
<
<
<
<
|
|

|
|

|

|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
<
<
<
1
2





3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56



#! /bin/env tclsh






package require ycl::context
variable context [yclprefix]::context

package require ycl::ns
variable ns [yclprefix]::ns

namespace export {[a-z]*}

proc new {} {
	variable context
	set res [$context]
	$res var FAIL 0
	$res var ACCEPT 1
	$res method parse
	return $res
}

proc parse {ctxt words_ newstates_} {
	variable ns
	upvar $words_ words
	upvar $newstates_ newstates
	foreach newstate $newstates {
		set normalized  [lindex $newstate 0] 
		set normalized  [uplevel [list ${ns}::nsnormalize] {[namespace current]} $normalized]
		lappend states [lreplace $newstate 0 0 $normalized]
	}

	set i -1 
	foreach word $words {
		incr i
		if {![llength $states]} {
			return $i
		}
		set newstates_total [list]
		set accept_total 0
		foreach state $states {	
			lassign [{*}$state $word] accepted newstates
			incr accept_total $accepted
			foreach newstate $newstates {
				#each state should only appear once in the list
				if {$newstate ni $newstates_total} {
					lappend newstates_total $newstate
				}
			}
		}
		if {$accept_total} {
			set states $newstates_total
		} else {
			return $i 
		}
	}
}

namespace ensemble create



Changes to parser/lib/parser.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#! /bin/env tclsh

interp alias {} f {} file

set scriptpath [info script]
set scriptdir [f dirname $scriptpath]
set scriptprefix [f dirname $scriptdir]
set scriptnormpath [f dirname [f normalize [f join [info script] __dummy__]] ] 
set scriptnormdir [f dirname $scriptnormpath]
set scriptnormprefix [f dirname $scriptnormdir]
foreach prefix [list $scriptprefix $scriptnormprefix] {
	set auto_path [linsert $auto_path[set auto_path {}] 0 [f join $prefix lib] ]
}

package require ycl::nsprefix

package require tcltest
eval ::tcltest::configure $argv
namespace import ::tcltest::*

package require ycl::context
variable context [::YCL(IMPORTPREFIX)]ycl::context

package require ycl::parser
variable parser [::YCL(IMPORTPREFIX)]ycl::parser

variable config [$context]
$context options
options var config $config
variable myparser [$parser new]
options var parser $myparser
options eval {
	variable cns [namespace current]
	proc start {ctxt} {
		return [list \
			[list $ctxt optOne] \
			[list $ctxt optTwo]
		]
	}
	$cns method start 

	proc optOne {ctxt val} {
		variable parser
		set match 0
		set states [list]
		if [string match -one $val] {
			set match [$parser var ACCEPT]
			lappend states [list $ctxt optval hello]
		}
		return [list $match $states]
	}
	$cns method optOne

	proc optTwo {ctxt val} {
		variable parser
		set match [$parser var FAIL]
		set states [list]
		if [string match -two $val] {
			set match [$parser var ACCEPT]
			lappend states [list $ctxt optval bloop]
		}
		return [list $match $states]
	}
	$cns method optTwo

	proc optval {ctxt var val} {
		variable parser
		variable config
		$config var $var $val
		return [list [$parser var ACCEPT] [$ctxt start]]
	}
	$cns method optval
}

variable states [options start]
variable options [list -one doober -two beans]
variable result [$myparser parse options states]
if {$result > -1} {
	puts "failed to parse: [lrange $options $result end]"
} else {
	puts "yeah: [$config $ hello]"
	puts "beah: [$config $ bloop]"
}


<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
1
2












3
4



5































































#! /bin/env tclsh













package require ycl::parser::test
[yclprefix]::parser::test::suite_main



































































Changes to parser/pkgIndex.tcl.
1
2
3












#! /bin/env tclsh

package ifneeded ycl::parser 0.1 [list source [file join $dir lib parser.tcl] ]














|
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/env tclsh

package ifneeded ycl::parser 0.1 [list apply {{dir} {
	package require ycl::package
	[yclprefix]::package::source parser \
		 [file join $dir lib parser.tcl] 
	package provide ycl::parser 0.1
}} $dir]

package ifneeded ycl::parser::test 0.1 [list apply {{dir} {
	package require ycl::package
	[yclprefix]::package::source parser::test \
		 [file join $dir lib parser.test.tcl] 
	package provide ycl::parser::test 0.1
}} $dir]
Changes to proc/lib/proc.tcl.
1
2
3
4
5
6
7
8
9
10
11
#! /bin/env tclsh

package require ycl::nsprefix

namespace eval doc {}

#value: the formal parameters of a procedure
proc formals proc {
	set callingspace [uplevel 1 namespace current]
	set args [info args $proc]
	set newargs [list]


<
<







1
2


3
4
5
6
7
8
9
#! /bin/env tclsh



namespace eval doc {}

#value: the formal parameters of a procedure
proc formals proc {
	set callingspace [uplevel 1 namespace current]
	set args [info args $proc]
	set newargs [list]
333
334
335
336
337
338
339
340
341
				}
			}
		}
	}
}

namespace export {[a-z]*}
package provide ycl::proc 0.1
return ${::YCL(IMPORTPREFIX)}::proc







<

331
332
333
334
335
336
337

338
				}
			}
		}
	}
}

namespace export {[a-z]*}

return ${::YCL(IMPORTPREFIX)}::proc
Changes to proc/pkgIndex.tcl.
1
2
3
4

5

6
#! /bin/env tclsh

package ifneeded ycl::proc 0.1 [list apply {{dir} {
		namespace eval ::ycl::proc [list  \

			source [file join $dir lib proc.tcl]] 

	}} $dir]



|
>
|
>
|
1
2
3
4
5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::proc 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source proc \
		 [file join $dir lib proc.tcl] 
	package provide ycl::proc 0.1
}} $dir]
Changes to pyim/lib/pyim.tcl.
900
901
902
903
904
905
906
907
namespace import ${::YCL(IMPORTPREFIX)}::proc::checkargs
package require ycl::verbose
namespace import $::YCL(IMPORTPREFIX)::verbose::verbose
namespace upvar $::YCL(IMPORTPREFIX)::verbose DBG_INFO DBG_INFO
namespace upvar $::YCL(IMPORTPREFIX)::verbose DBG_INFO DBG_ERROR
package require ycl::tmpfile
namespace import $::YCL(IMPORTPREFIX)::tmpfile::mktemp
package provide ycl::pyim 0.1







<
900
901
902
903
904
905
906

namespace import ${::YCL(IMPORTPREFIX)}::proc::checkargs
package require ycl::verbose
namespace import $::YCL(IMPORTPREFIX)::verbose::verbose
namespace upvar $::YCL(IMPORTPREFIX)::verbose DBG_INFO DBG_INFO
namespace upvar $::YCL(IMPORTPREFIX)::verbose DBG_INFO DBG_ERROR
package require ycl::tmpfile
namespace import $::YCL(IMPORTPREFIX)::tmpfile::mktemp

Changes to pyim/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
#! /bin/env tclsh

package ifneeded ycl::pyim 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::pyim [list  \
			source [file join $dir lib pyim.tcl]] 

	}} $dir]



<
|
<
|
|
>
|
1
2
3

4

5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::pyim 0.1 [list apply {{dir} {

	package require ycl::package

	${::YCL(IMPORTPREFIX)}::package::source pyim \
		 [file join $dir lib pyim.tcl] 
	package provide ycl::pyim 0.1
}} $dir]
Changes to rfc/lib/2616.tcl.
1
2
3
4
5
6
7
8
9
10
#! /bin/env tclsh

package provide ycl::rfc::2616 0.1

variable httpversion "HTTP/\${version}/"
namespace eval header {
}





<







1
2

3
4
5
6
7
8
9
#! /bin/env tclsh



variable httpversion "HTTP/\${version}/"
namespace eval header {
}



Changes to rfc/lib/3986.tcl.
1
2
3
#! /bin/env tclsh

package provide ycl::rfc::3986 0.1


<
1
2

#! /bin/env tclsh


Name change from rfc/lib/822::headers.tcl to rfc/lib/822_headers.tcl.
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
		   [ format "%s:%s" $hf [ lindex $l $i ] ]
		incr is($hf)
	}
	## .
	return
}

package provide ycl::rfc::822::headers 0.3

### Emacs stuff
## Local variables:
## fill-column: 72
## indent-tabs-mode: nil
## ispell-local-dictionary: "english"
## mode: outline-minor
## outline-regexp: "###\\|proc"







<
<







144
145
146
147
148
149
150


151
152
153
154
155
156
157
		   [ format "%s:%s" $hf [ lindex $l $i ] ]
		incr is($hf)
	}
	## .
	return
}



### Emacs stuff
## Local variables:
## fill-column: 72
## indent-tabs-mode: nil
## ispell-local-dictionary: "english"
## mode: outline-minor
## outline-regexp: "###\\|proc"
Changes to rfc/pkgIndex.tcl.
1
2
3
4
5

6
7
8
9
10
11

12
13
14
15
16
17

18
19
20
21
22
23

24
25
26
27
28
29

30
31
#! /bin/env tclsh

package ifneeded ycl::rfc 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc [file join $dir lib rfc.tcl] 

    }} $dir]

package ifneeded ycl::rfc::822 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc::822 \
		[file join $dir lib 822.tcl]

	}} $dir]

package ifneeded ycl::rfc::822::headers 0.3 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc::822::headers \
		[file join $dir lib 822::headers.tcl]

	}} $dir]

package ifneeded ycl::rfc::3986 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc::3986 \
		[file join $dir lib 3986.tcl] 

    }} $dir]

package ifneeded ycl::rfc::2616 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc::2616 \
		[file join $dir lib 2616.tcl] 

    }} $dir]






>
|





>
|




|
>
|





>
|





>
|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/env tclsh

package ifneeded ycl::rfc 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc [file join $dir lib rfc.tcl] 
	package provide ycl::rfc 0.1
}} $dir]

package ifneeded ycl::rfc::822 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc::822 \
		[file join $dir lib 822.tcl]
	package provide ycl::rfc::822 0.1
}} $dir]

package ifneeded ycl::rfc::822::headers 0.3 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc::822::headers \
		[file join $dir lib 822_headers.tcl]
	package provide ycl::rfc::822::headers 0.3
}} $dir]

package ifneeded ycl::rfc::3986 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc::3986 \
		[file join $dir lib 3986.tcl] 
	package provide ycl::rfc::3986 0.1
}} $dir]

package ifneeded ycl::rfc::2616 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source rfc::2616 \
		[file join $dir lib 2616.tcl] 
	package provide ycl::rfc::2616 0.1
}} $dir]

Changes to string/lib/chan.tcl.
394
395
396
397
398
399
400
401
variable chancount
variable rythm 5
### private functions ###
proc K {x y} {set x}
namespace export {[a-z]*}
namespace ensemble create

package provide ycl::string::chan 0.1







<
394
395
396
397
398
399
400

variable chancount
variable rythm 5
### private functions ###
proc K {x y} {set x}
namespace export {[a-z]*}
namespace ensemble create


Changes to string/lib/chan.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#! /bin/env tclsh

proc bgerror args {
	set code $::errorCode
	puts $::errorInfo
	return -code error 
}

variable mydir [file dirname [info script]]
variable parentdir [file dirname $mydir]
set auto_path [linsert $auto_path[unset auto_path] 0 [file dirname $mydir]]
set auto_path [linsert $auto_path[unset auto_path] 0 [file dirname $parentdir]]

package require ycl::test
package require ycl::string::chan
variable schan ${::YCL(IMPORTPREFIX)}::string::chan
package require ycl::sugar
namespace import ${::YCL(IMPORTPREFIX)}::sugar::cset

test chan {basic test of string channel} -body {
	set res [list]
	cset chan $schan open access r+ data "hello there"
	#cset data read $chan
	chan configure $chan -blocking 1
	set data [read $chan]
	puts $chan ", Bob"
	chan flush $chan
	lappend res $data

	seek $chan 0
	set data [read $chan]
	lappend res $data

	seek $chan -3 current
	set data [read $chan]
	lappend res $data

	close $chan
	set res
} -result [list "hello there" "hello there, Bob\n" "ob\n"]

test seek {basic seek test} -body {
	set res [list]
	cset chan $schan open access r+ data {}
	chan configure $chan -blocking 1
	seek $chan 3
	puts $chan hello
	flush $chan
	seek $chan 0
	lappend res [read $chan]
	lappend res [tell $chan]
	seek $chan -2 end
	lappend res [read $chan]
	seek $chan -2 end
	seek $chan -2 current
	lappend res [read $chan]
	seek $chan 3 ;#get past the three leading 0's
	seek $chan 1 current
	lappend res [read $chan]
	seek $chan 6 start 
	lappend res [read $chan]
	seek $chan 4 
	puts $chan "owdy"
	chan flush $chan
	seek $chan 3 
	lappend res [read $chan]
	seek $chan 4 
	puts -nonewline $chan "ip"
	chan flush $chan
	seek $chan 3 
	lappend res [read $chan]
	set res
} -result [list \0\0\0hello\n 9 o\n llo\n ello\n lo\n howdy\n hipdy\n]

test access_read {read access} -body {
	set res [list]
	cset output $schan open access r data "hello there" 
	lappend res [read $output]
	set res
} -result [list "hello there"]

test access_gets {gets access} -body {
	set res [list]
	cset output $schan open access r data "hello there\ngoodbye now" 
	lappend res [gets $output]
	lappend res [gets $output]
	set res
} -result [list "hello there" "goodbye now"]

test access_read_noexist {read access to a non-existent file} -body {
	set res [list]
	cset output $schan open access r
	read $output
} -returnCodes [list 1] -result "access is \"r\", but no variable name was found and no data was found.  Either use \"data\" option or \"name\" an existing variable"

test fifo_blocking {basic fifo test} -body {
	set res [list]
	cset chan $schan open access w
	puts $chan "read this data!"
	flush $chan
	cset chanout $schan open attach $chan access r
	close $chan
	lappend res [read $chanout]
	close $chanout
	set res
} -result [list "read this data!\n"] 


test size {basic test of size limit} -body {
	set res [list]
	cset chan $schan open access w data {}
	chan configure $chan -size 3
	catch {
		puts $chan "howdy"
		flush $chan
	} catchres catchopt
	lappend res [expr {[\
		string first "would exceed file size limitation of 3 bytes" $catchopt] >-1}]
	set res
} -match glob -result  [list 1]

test fifo_nonblocking {basic fifo nonblocking test} -body {
	set ::res [list]
	cset input $schan open access a data "hello there" 
	cset output $schan open attach $input access r
	chan configure $output -pipe 1
	chan configure $output -blocking 0
	set bgproc { chan {
		lappend ::res [read $chan]
		if {[eof $chan]} {
			set ::resdone 1
		}
	}}
	chan event $output readable [list apply $bgproc $output]
	puts $input "goodbye there" 
	close $input
	vwait ::resdone
	close $output
	set ::res
} -result [list "hello there" "goodbye there\n" {}]

test fifo_throughput {} -body {
	set ::res [list]
	set ::counter 0
	cset input $schan open access a
	chan configure $input -blocking 0
	chan configure $input -pipe 1
	cset output $schan open attach $input
	chan configure $output -pipe 1
	set bgwrite { chan {
		puts $chan "more data [incr ::counter]"
		flush $chan
	}}
	chan event $input writable [list apply $bgwrite $input]
	set bgread { chan {
		lappend ::res [read $chan]
		if {[llength $::res] > 10} {
			set ::resdone_fifo_throughput 1
		}
	}}
	chan event $output readable [list apply $bgread $output]
	vwait ::resdone_fifo_throughput
	close $input
	close $output
	return $::res
} -result [list \
	"more data 1\n" \
	"more data 2\n" \
	"more data 3\n" \
	"more data 4\n" \
	"more data 5\n" \
	"more data 6\n" \
	"more data 7\n" \
	"more data 8\n" \
	"more data 9\n" \
	"more data 10\n" \
	"more data 11\n" \
]


cleanupTests


<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
1
2











3
4






































































































































































#! /bin/env tclsh












package require ycl::string::chan::test
ycl::string::chan::test::suite_main






































































































































































Changes to string/pkgIndex.tcl.
1
2
3
4
5


6
7
8
9
10

11







12
#! /bin/env tclsh

package ifneeded ycl::string 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source string [file join $dir lib string.tcl] 


    }} $dir]

package ifneeded ycl::string::chan 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source string::chan [file join $dir lib chan.tcl] 

    }} $dir]












|
>
>
|




>
|
>
>
>
>
>
>
>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/env tclsh

package ifneeded ycl::string 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source string \
		[file join $dir lib string.tcl] 
	package provide ycl::string 0.1
}} $dir]

package ifneeded ycl::string::chan 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source string::chan [file join $dir lib chan.tcl] 
	package provide ycl::string::chan 0.1
}} $dir]

package ifneeded ycl::string::chan::test 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source string::chan::test [file join $dir lib chan.test.tcl] 
	package provide ycl::string::chan::test 0.1
}} $dir]


Changes to sugar/lib/sugar.tcl.
24
25
26
27
28
29
30
31
proc cset {var args} {
	upvar $var upvar
	set upvar [{*}$args]
	return $upvar
}

namespace export {[a-z]*}
package provide ycl::sugar 0.1







<
24
25
26
27
28
29
30

proc cset {var args} {
	upvar $var upvar
	set upvar [{*}$args]
	return $upvar
}

namespace export {[a-z]*}

Changes to sugar/pkgIndex.tcl.
1
2
3
4
5

6
#! /bin/env tclsh

package ifneeded ycl::sugar 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source sugar [file join $dir lib sugar.tcl] 

    }} $dir]





>
|
1
2
3
4
5
6
7
#! /bin/env tclsh

package ifneeded ycl::sugar 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source sugar [file join $dir lib sugar.tcl] 
	package provide ycl::sugar 0.1
}} $dir]
Changes to test/lib/test.tcl.
1
2
3
4
5
6
7
8
9
#! /bin/env tclsh

namespace eval :: {
	package require tcltest 2.2
	namespace import ::tcltest::*
	eval ::tcltest::configure $::argv
}

package provide ycl::test 0.1








<
1
2
3
4
5
6
7
8

#! /bin/env tclsh

namespace eval :: {
	package require tcltest 2.2
	namespace import ::tcltest::*
	eval ::tcltest::configure $::argv
}


Changes to test/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
#! /bin/env tclsh

package ifneeded ycl::test 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::test [list  \
			source [file join $dir lib test.tcl]] 

	}} $dir]



<
|
<
|
|
>
|
1
2
3

4

5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::test 0.1 [list apply {{dir} {

	package require ycl::package

	${::YCL(IMPORTPREFIX)}::package::source test \
		 [file join $dir lib test.tcl] 
	package provide ycl::test 0.1
}} $dir]
Changes to tmpfile/lib/tmpfile.tcl.
89
90
91
92
93
94
95
96
			close $chan
			return $newdir
		}
	}
}

namespace export {[a-z]*}
package provide ycl::tmpfile 0.1







<
89
90
91
92
93
94
95

			close $chan
			return $newdir
		}
	}
}

namespace export {[a-z]*}

Changes to tmpfile/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
10
11
#! /bin/env tclsh

package ifneeded ycl::tmpfile 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::tmpfile [list  \
			source [file join $dir lib tmpfile.tcl]] 

	}} $dir]





<
|
<
|
|
>
|
<

1
2
3

4

5
6
7
8

9
#! /bin/env tclsh

package ifneeded ycl::tmpfile 0.1 [list apply {{dir} {

	package require ycl::package

	${::YCL(IMPORTPREFIX)}::package::source tmpfile \
		 [file join $dir lib tmpfile.tcl] 
	package provide ycl::tmpfile 0.1
}} $dir]


Changes to verbose/lib/verbose.tcl.
47
48
49
50
51
52
53
54
55
### end constants ###

variable channel stderr
variable level $DBG_NOTICE

namespace export {[a-z]*} 


package provide ycl::verbose 0.1







<
<
47
48
49
50
51
52
53


### end constants ###

variable channel stderr
variable level $DBG_NOTICE

namespace export {[a-z]*} 



Changes to verbose/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
10
#! /bin/env tclsh

package ifneeded ycl::verbose 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::verbose [list  \
			source [file join $dir lib verbose.tcl]] 

	}} $dir]




<
|
<
|
|
>
|

1
2
3

4

5
6
7
8
9
#! /bin/env tclsh

package ifneeded ycl::verbose 0.1 [list apply {{dir} {

	package require ycl::package

	${::YCL(IMPORTPREFIX)}::package::source verbose \
		 [file join $dir lib verbose.tcl] 
	package provide ycl::verbose 0.1
}} $dir]

Changes to xz/lib/cmd.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
#! /bin/env tclsh

namespace eval doc {}


variable doc::compress {
	description {
		use xz cmd to perform compression
	}
	args {
		keep {
			description {




<







1
2
3
4

5
6
7
8
9
10
11
#! /bin/env tclsh

namespace eval doc {}


variable doc::compress {
	description {
		use xz cmd to perform compression
	}
	args {
		keep {
			description {
27
28
29
30
31
32
33
34
35
	checkargs doc::compress args
	set stdout 0
	if {$keep} {
		lappend xzopts -k
	}
	exec xz {*}$xzopts
}

package provide ycl::xz::cmd 0.1







<
<
26
27
28
29
30
31
32


	checkargs doc::compress args
	set stdout 0
	if {$keep} {
		lappend xzopts -k
	}
	exec xz {*}$xzopts
}


Changes to xz/pkgIndex.tcl.
1
2
3
4
5


6
7
8
9
10


11
12
#! /bin/env tclsh

package ifneeded ycl::xz 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source xz [file join $dir lib xz.tcl] 


    }} $dir]

package ifneeded ycl::xz::cmd 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source xz::cmd [file join $dir lib cmd.tcl] 


    }} $dir]





|
>
>
|



|
>
>
|
<
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

#! /bin/env tclsh

package ifneeded ycl::xz 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source xz \
		[file join $dir lib xz.tcl] 
	package provie ycl::xz 0.1
}} $dir]

package ifneeded ycl::xz::cmd 0.1 [list apply {{dir} {
	package require ycl::package
	${::YCL(IMPORTPREFIX)}::package::source xz::cmd \
		[file join $dir lib cmd.tcl] 
	package provide ycl::xz::cmd 0.1
}} $dir]

Changes to ycl/lib/ycl.tcl.
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
		interp alias {} $token {}
		rename [namespace current]::namespace ::namespace
	}
}

proc namespace_ycl {args} {
	variable importprefix
	variable yclprefix
	set cmd [lindex $args 0]
	if {$cmd eq "eval"} {
		set ns [lindex $args 1]
		if {[set start [string first $yclprefix $ns]] == 0} {
			set ns ${importprefix}::[string range $ns [ \
				string length $yclprefix] end]
			lset args 1 $ns
		}
	}
	uplevel [list [namespace current]::namespace {*}$args]
}

variable yclprefix ::ycl:: 
variable importprefix [namespace current]

namespace export {[a-z]*}
namespace ensemble create
#make sure to use the global package command
::package provide ycl 0.1








<



|

|






<




<
<
<
48
49
50
51
52
53
54

55
56
57
58
59
60
61
62
63
64
65
66

67
68
69
70



		interp alias {} $token {}
		rename [namespace current]::namespace ::namespace
	}
}

proc namespace_ycl {args} {
	variable importprefix

	set cmd [lindex $args 0]
	if {$cmd eq "eval"} {
		set ns [lindex $args 1]
		if {[set start [string first [yclprefix] $ns]] == 0} {
			set ns ${importprefix}::[string range $ns [ \
				string length [yclprefix] end]
			lset args 1 $ns
		}
	}
	uplevel [list [namespace current]::namespace {*}$args]
}


variable importprefix [namespace current]

namespace export {[a-z]*}
namespace ensemble create



Changes to ycl/pkgIndex.tcl.
1
2
3






4











5


6
7


8

9
#! /bin/env tclsh

package ifneeded ycl 0.1 [list apply {{dir} {






		if {![info exists ::YCL(IMPORTPREFIX)]} {











			set ::YCL(IMPORTPREFIX) ::ycl


		}
		namespace eval ${::YCL(IMPORTPREFIX)} [list  \


			source [file join $dir lib ycl.tcl]] 

	}} $dir]



>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
>
>

|
>
>
|
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/env tclsh

package ifneeded ycl 0.1 [list apply {{dir} {
	proc yclprefix {args} {
		global env
		global YCL
		set prefix ::ycl
		set argl [llength $args]
		if {$argl == 0 } {
			if {![info exists YCL(IMPORTPREFIX)]} {
				if [info exists env(YCL(IMPORTPREFIX))] {
					set YCL(IMPORTPREFIX) $env(YCL(IMPORTPREFIX))
				} else {
					set YCL(IMPORTPREFIX) $prefix 
				}
			}
		} elseif {$argl == 1} {
			set name [lindex $args 0]
			if {![string match ::* $name]} {
				return -code error "name must be absolute: $name"
			}
			set YCL(IMPORTPREFIX) $name
		} else {
			return -code error "wrong # of args.  Should be 0 or 1" 
		}
		return $YCL(IMPORTPREFIX)
	}
	namespace eval [yclprefix] [list  \
		source [file join $dir lib ycl.tcl]]
	package provide ycl 0.1
}} $dir]
Changes to yobj/lib/yobj.tcl.
63
64
65
66
67
68
69
70
	}
	return $ns
}


namespace export {[a-z]*}
namespace ensemble create
package provide ycl::yobj 0.1







<
63
64
65
66
67
68
69

	}
	return $ns
}


namespace export {[a-z]*}
namespace ensemble create

Changes to yobj/pkgIndex.tcl.
1
2
3
4
5
6
7
8

9
#! /bin/env tclsh

package ifneeded ycl::yobj 0.1 [list apply {{dir} {
		if {![info exists ::YCL(IMPORTPREFIX)]} {
			set ::YCL(IMPORTPREFIX) ::ycl
		}
		namespace eval ${::YCL(IMPORTPREFIX)}::yobj [list  \
			source [file join $dir lib yobj.tcl]] 

	}} $dir]



<
|
<
|
|
>
|
1
2
3

4

5
6
7
8
#! /bin/env tclsh

package ifneeded ycl::yobj 0.1 [list apply {{dir} {

	package require ycl::package

	${::YCL(IMPORTPREFIX)}::package::source yobj \
		 [file join $dir lib yobj.tcl] 
	package provide ycl::yobj 0.1
}} $dir]
Changes to yparse/lib/parser.tcl.
1
2
3
4
5
6
7
8
9
10
#! /bin/env tclsh

package require ycl::nsprefix
package require ycl::yobj
variable yobj ${::YCL(IMPORTPREFIX)}::yobj
package require ycl::dict

proc new args {
	variable yobj



<







1
2

3
4
5
6
7
8
9
#! /bin/env tclsh


package require ycl::yobj
variable yobj ${::YCL(IMPORTPREFIX)}::yobj
package require ycl::dict

proc new args {
	variable yobj

Changes to yparse/lib/parser/UsaaStatement.tcl.
360
361
362
363
364
365
366


		}
	}
	set description [string range $data $i end]
	return [list $amount $description]
}









>
360
361
362
363
364
365
366
367

		}
	}
	set description [string range $data $i end]
	return [list $amount $description]
}

package provide ycl::yparse::parser::UsaaStatement 0.1
Name change from yparse/lib/parserHttp.test to yparse/lib/parser/http.test.
Deleted yparse/lib/parserUsaaStatement.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
#! /bin/env tclsh

proc infilter {self data} {
	regsub -all {\x0c} $data {} data
	return $data
}

proc start self {
	set data [set ${self}::data]
	if {[$self match_statement_date_header $data]} {
		$self do_statement_date_header
		set ${self}::stage statement_date_header 
		lappend ${self}::next $self
	} else {
		lappend ${self}::next $self
	}
}

proc do_statement_date_header self {
}

proc statement_date_header self {
	$self do_statement_date
	set ${self}::stage statement_date 
	lappend ${self}::next $self
}

proc do_statement_date self {
	set data [set ${self}::data]
	set data [clock scan $data]
	set ${self}::statement_date $data
	set data [clock format $data]]
	lappend ${self}::outputs [dict create statement_date $data]
}

proc statement_date self {
	set data [set ${self}::data]
	if {[$self match_deposits_header $data]} {
		$self do_deposits_header
		set ${self}::stage deposits_header
		lappend ${self}::next $self
	} else {
		lappend ${self}::next $self
	}
}

proc do_deposits_header self {
}

proc deposits_header self {
	$self do_deposits_columnnames
	set ${self}::stage deposits_columnnames
	lappend ${self}::next $self
}

proc do_deposits_columnnames self {
}

proc deposits_columnnames self {
	set data [set ${self}::data]
	if {$data eq {}} {
		lappend ${self}::next $self
	} elseif {[$self match_checks_header $data]} {
		$self do_checks_header
	} else {
		$self do_deposits_date
		set ${self}::stage deposits_date
		lappend ${self}::next $self
	}
}

proc do_deposits_date self {
	lappend ${self}::keys deposit
	set data [set ${self}::data]
	dict set ${self}::output date [$self date_normalize $data/[ \
		clock format [set ${self}::statement_date] -format %Y]] \
}

proc deposits_date self {
	$self do_deposits_amount
	set ${self}::stage deposits_description
	lappend ${self}::next $self
}

proc do_deposits_amount self {
	set data [set ${self}::data]
	foreach {amount description} [$self amount_split $data] {}
	dict set ${self}::output amount $amount
	dict lappend ${self}::output description $description
}

proc deposits_description self {
	set data [set ${self}::data]
	if {$data eq {}} {
		$self do_end_deposits
		set ${self}::stage end_deposits
		lappend ${self}::next $self
	} elseif {[$self match_checks_header $data]} {
		$self do_end_deposits
		$self do_checks_header
		set ${self}::stage checks_header
		lappend ${self}::next $self
	} elseif {[$self match_deposits_columnnames $data]} {
		$self do_end_deposits
		$self do_deposits_columnnames
		set ${self}::stage deposits_columnnames
		lappend ${self}::next $self
	} elseif {[$self match_deposits_date $data]} {
		$self output
		$self do_deposits_date
		set ${self}::stage deposits_date
		lappend ${self}::next $self
	} else {
		#continuation of deposits_description
		$self do_deposits_description
		lappend ${self}::next $self
	}
}

proc do_deposits_description self {
	#continuation of description
	dict lappend ${self}::output description [set ${self}::data]
}

proc do_end_deposits self {
	$self output
}

proc end_deposits self {
	set data [set ${self}::data]
	if {$data eq {}} {
		lappend ${self}::next $self 
	} elseif {[$self match_deposits_header $data]} {
		$self do_deposits_header
		set ${self}::stage deposits_header
	lappend ${self}::next $self
	} elseif {[$self match_checks_header $data]} {
		$self do_checks_header
		set ${self}::stage checks_header
		lappend ${self}::next $self
	}
}

proc do_checks_header self {
}

proc checks_header self {
	$self do_checks_column_names
	set ${self}::stage checks_column_names
	lappend ${self}::next $self
}

proc do_checks_column_names self {
}

proc checks_column_names self {
	$self do_check_date
	set ${self}::stage check_date
	lappend ${self}::next $self
}

proc do_check_date self {
	lappend ${self}::keys check
	set data [set ${self}::data]
	dict set ${self}::output date [$self date_normalize $data/[ \
		clock format [set ${self}::statement_date] -format %Y]]
}

proc check_date self {
	$self do_check_number
	set ${self}::stage check_number
	lappend ${self}::next $self
}

proc do_check_number self {
	set data [set ${self}::data]
	dict set ${self}::output reference $data
}

proc check_number self {
	$self do_check_amount
	set ${self}::stage check_amount
	lappend ${self}::next $self
}

proc do_check_amount self {
	set data [set ${self}::data]
	foreach {amount description} [$self amount_split $data] {} 
	dict set ${self}::output amount [$self amount_negate $amount] 
	$self output
}

proc check_amount self {
	set data [set ${self}::data]
	if {$data eq {}} {
		$self do_end_checks
		set ${self}::stage end_checks
		lappend ${self}::next $self
	} else {
		$self do_check_date
		set ${self}::stage check_date
		lappend ${self}::next $self
	}
}

proc do_end_checks self {
}

proc end_checks self {
	set data [set ${self}::data]

	if {[$self match_checks_column_names $data]} {
		$self do_checks_column_names
		set ${self}::stage checks_column_names
		lappend ${self}::next $self
	} elseif {[$self match_other_debits_header $data]} {
		$self do_other_debits_header
	} else {
		#ignores any "junk" lines
		lappend ${self}::next $self
	}
}

proc do_other_debits_header self {
	set ${self}::stage other_debits_header
	lappend ${self}::next $self
}

proc other_debits_header self {
	$self do_other_debits_column_names
}

proc do_other_debits_column_names self {
	set ${self}::stage other_debits_column_names
	lappend ${self}::next $self
}

proc other_debits_column_names self {
	set data [set ${self}::data]
	if {[regexp {^\d\d/\d\d$} $data]} {
		$self do_other_debits_date
	} else {
		$self do_end_other_debits
	}
}

proc do_other_debits_date self {
	lappend ${self}::keys other_debit
	set data [set ${self}::data]
	dict set ${self}::output date [$self date_normalize $data/[\
		clock format [set ${self}::statement_date] -format %Y]]
	set ${self}::stage other_debits_date
	lappend ${self}::next $self
}

proc other_debits_date self {
	set data [set ${self}::data]
	$self do_other_debits_amount
}

proc do_other_debits_amount self {
	set data [set ${self}::data]
	foreach {amount description} [$self amount_split $data] {}
	dict set ${self}::output amount [$self amount_negate $amount]
	if {[string length $description]} {
		dict lappend ${self}::output description $description 
	}
	set ${self}::stage other_debits_description
	lappend ${self}::next $self
}

proc do_other_debits_description self {
	set data [set ${self}::data]
	dict lappend ${self}::output description $data 
}

proc other_debits_description self {
	set data [set ${self}::data]
	if {$data eq {} || [string match -nocase {ACCOUNT BALANCE SUMMARY} $data] } {
		$self output
		$self do_end_other_debits
	} elseif {[regexp {^\d\d/\d\d$} $data]} {
		$self output
		$self do_other_debits_date
	} else {
		#description spans multiple lines
		$self do_other_debits_description
		set ${self}::stage other_debits_description
		lappend ${self}::next $self
	}
}

proc do_end_other_debits self {
	set ${self}::stage end_other_debits
	lappend ${self}::next $self
}

proc end_other_debits self {
	set data [set ${self}::data]
		if {[$self match_other_debits_header $data]} {
		$self do_other_debits_header
	} else {
		lappend ${self}::next $self
	}
}


#### match functions ####
proc match_statement_date_header {self data} {
	return [string match {STATEMENT DATE} $data]
}


proc match_deposits_header {self data} {
	return [string match {DEPOSITS AND OTHER CREDITS} $data]
}

proc match_deposits_columnnames {self data} {
	return [string equal -nocase [regsub -all {\s} $data {}] DATE..........AMOUNT.TRANSACTIONDESCRIPTION]
}

proc match_deposits_date {self data} {
	set res [regexp {^[[:digit:]]{2}/[[:digit:]]{2}(?:[[:space:]]|$)} $data ]
	return $res
}

proc match_checks_header {self data} {
	return [string match CHECKS $data]
}

proc match_checks_column_names {self data} {
	return [string match {DATE..CHECKNO...........AMOUNT} [regsub -all { } $data {}]]
}

proc match_other_debits_header {self data} {
	return [string match {OTHERDEBITS} [regsub -all {\s} $data {}]]
}

proc amount_negate {self data} {
	format %.2f [expr $data * -1]
}

proc date_normalize {self data} {
	set data [clock scan $data]
	set data [clock format $data -format %Y-%m-%d]
}

proc amount_split {self data} {
	set dlen [string length $data]
	set amount {}
	for {set i 0} {$i<$dlen} {incr i} {
		set char [string index $data $i]
		if {[string is space $char] || [string equal $char ,]} {
		} else {
			if {[string is double ${amount}$char]} {
				set amount ${amount}$char
			} else {
				break
			}

		}
	}
	set description [string range $data $i end]
	return [list $amount $description]
}

package provide ycl::yparse::parser::UsaaStatement 0.1
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































































































































































































































































































































































































































































































































































































































Changes to yparse/lib/yparse.tcl.
1
2
3
4
5
6
7
8
9
10
#! /bin/env tclsh

package require ycl::nsprefix
package require ycl::yobj
package require ycl::verbose
variable verbose ${::YCL(IMPORTPREFIX)}::verbose
interp alias {} verbose {} ${verbose}::verbose
namespace upvar $verbose DBG_DEBUG DBG_DEBUG

variable yobj ${YCL(IMPORTPREFIX)}::yobj


<







1
2

3
4
5
6
7
8
9
#! /bin/env tclsh


package require ycl::yobj
package require ycl::verbose
variable verbose ${::YCL(IMPORTPREFIX)}::verbose
interp alias {} verbose {} ${verbose}::verbose
namespace upvar $verbose DBG_DEBUG DBG_DEBUG

variable yobj ${YCL(IMPORTPREFIX)}::yobj