List Info

Thread: InitPrefix meta data usage in tclpe




InitPrefix meta data usage in tclpe
user name
2007-06-07 09:37:43

What is the correct usage of the InitPrefix metadata in tclpe?  From the documentation I was assuming InitPrefix  <file&gt; <code> <file&gt; <code&gt; …

 

Here is how I’m adding it “InitPrefix  test_utils.tcl test1̶1;.  In the generated pkgIndex.tcl file it creates the following which isn’t correct on the source line.

 

# Meta Begin

# Package test_utils 2.00

# Meta description

# Meta platform   ; tcl

# Meta End

 

 

if {![package vsatisfies [package provide Tcl] 8.4]} return

 

package ifneeded test_utils 2.00 [string map [list $dir] {

 &nbsp; &nbsp; &nbsp; &nbsp;   ; source [file join {} test_utils.tcl] test1

 

 &nbsp; &nbsp; &nbsp;  # ACTIVESTATE TEAPOT-PKG BEGIN DECLARE

 

 &nbsp; &nbsp; &nbsp;  package provide test_utils 2.00

 

 &nbsp; &nbsp; &nbsp;  # ACTIVESTATE TEAPOT-PKG END DECLARE

 &nbsp;  }]

 

 

NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Re: InitPrefix meta data usage in tclpe
user name
2007-06-07 12:34:18
I have to apologize. The documentation is wrong. I had to source dive a to refresh my own memory ...
 
The heuristic scanner creating a draft teapot.txt from code generates 'InitPrefix' to associate 'load'ed files with a package name to use when constructing XXX_Init.
 
I.e. if the scanner picks up a command
 
 &nbsp;  load FOO.so
 
nothing is done. If however the found load command is of the form
 
 &nbsp;  load FOO.so XXX
 
then 'InitPrefix' is generated and maps from FOO.so to XXX so that the generator can properly recreate this load command. For source'd files this is obviously nonsense. Note however that you can shoehorn the extended semantics into the InitPrefix if you add newlines at the beginning of your codefragments, or semicolons.
 
I will fix the documentation.
 
--
 &nbsp;   ; &nbsp; Andreas Kupries <andreaskActiveState.com>
&nbsp;   ; &nbsp;  Developer http://www.ActiveState.com
&nbsp; &nbsp; &nbsp; &nbsp; Tel: +1 778-786-1122
 
-----Original Message-----
From: tdk-bounceslistserv.ActiveState.com [mailto:tdk-bounceslistserv.ActiveState.com]On Behalf Of Brandt, Joe
Sent: Thursday, June 07, 2007 7:38 AM
To: tdklistserv.ActiveState.com
Subject: [TDK] InitPrefix meta data usage in tclpe

What is the correct usage of the InitPrefix metadata in tclpe?&nbsp; From the documentation I was assuming InitPrefix  <file&gt; <code&gt; <file&gt; <code&gt; …

 

Here is how I’m adding it “InitPrefix  test_utils.tcl test1̶1;.  In the generated pkgIndex.tcl file it creates the following which isn’t correct on the source line.

 

# Meta Begin

# Package test_utils 2.00

# Meta description

# Meta platform&nbsp; &nbsp; tcl

# Meta End

 

 

if {![package vsatisfies [package provide Tcl] 8.4]} return

 

package ifneeded test_utils 2.00 [string map [list $dir] {

 &nbsp; &nbsp; &nbsp; &nbsp;   ; source [file join {} test_utils.tcl] test1

 

 &nbsp; &nbsp; &nbsp;  # ACTIVESTATE TEAPOT-PKG BEGIN DECLARE

 

 &nbsp; &nbsp; &nbsp;  package provide test_utils 2.00

 

 &nbsp; &nbsp; &nbsp;  # ACTIVESTATE TEAPOT-PKG END DECLARE

 &nbsp;  }]

 

 

NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )