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
|
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
|
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# "file1.eagle", and "platform.eagle").
#
package require Eagle.Platform
package require Eagle.Auxiliary
package require Eagle.File
#
# NOTE: This block is intended to be evaluated successfully by native
# Tcl only.
# NOTE: This block is intended to be evaluated successfully by native Tcl
# only. It serves two purposes:
#
# 1. Import the Eagle core script library procedures that are used
# by this package into the global namespace.
#
# 2. Unset the "pkgr_path" (namespace) variable that was created by
# the auto-path adjustment script fragment (above).
#
if {[info exists pkgr_path]} then {
catch {
::Eagle::exportAndImportPackageCommands ::Eagle \
[list appendArgs getDictionaryValue isEagle \
isWindows readFile writeFile] false false
}
unset -nocomplain pkgr_path
}
#
# NOTE: This procedure is used to provide a TIP #194 compatible [apply]
# command to the native Tcl 8.4 interpreter. Eagle and native Tcl
# 8.5 (or higher) have this command built-in.
#
if {[llength [info commands ::apply]] == 0} then {
proc ::apply { lambdaExpr args } {
set length [llength $lambdaExpr]
if {$length < 2 || $length > 3} {
error [appendArgs \
"can't interpret \"" $lambdaExpr "\" as a lambda expression"]
}
foreach {procArgs procBody procNamespace} $lambdaExpr {break}
set procNameSuffix [::PackageRepository::getUniqueSuffix 2]
set procName [appendArgs :: $procNamespace ::lambda_ $procNameSuffix]
set procPreBody {rename [lindex [info level 0] 0] "";}
proc $procName $procArgs [appendArgs $procPreBody $procBody]
return [uplevel 1 [list $procName] $args]
}
}
#
# NOTE: This procedure returns a formatted, possibly version-specific,
# package name, for use in logging.
#
proc formatPackageName { package version } {
return [string trim [appendArgs $package " " $version]]
|