From: Peter Spjuth on
Andreas Leitgeb wrote:

> PS: (PostScriptum, but also addressed to Peter Spjuth :-)
> lately I failed getting nagelfar to accept version 8.5 stuff
> (which I think to remember worked previously) - I definitely
> start nagelfar.tcl with tclsh8.5) e.g.: {expand}.. and lassign

Did you generate a database from an 8.5 interpreter?
Nagelfar expects that it is checking for the interpreter that generated
the database, and thus disallows 8.5 features with the database
in the distribution (8.4 based).

One of the first lines in syntaxdb.tcl tells what it was generated
from, and you can also see it in the About window in the GUI.

This might not be documented well enough...

/Peter

From: Svenn Bjerkem on
Davy wrote:
> Hi Svenn,
>
> Thanks a lot :)
>
> I have download a ActiveState Tcl tool. TkCon seems to be a
> line-by-line Tcl interprator. Do you mean enter the line of code to
> TkCon? Then run, and copy them out?

I think Suchenwirth gave a nice little session example maybe a bit
advanced as he introduced namespaces in Lection 1, but on the other
hand it is important to understand the difference of local and global
variables between Tcl and Perl.

You can develop your procs in tkcon from scratch or you can copy-paste
them between the NC-Sim command line and tkcon. If you want to develop
a proc from scratch in tkcon you just start hacking right away:
1% proc hello {args} {
puts "Hello friend, you gave me $args to chew on"
}
2 % hello World
Hello friend, you gave me World to chew on
3 %

With the arrow buttons you go back in history, and if you want to
insert a line you use ctrl-Enter. When you are finished with the
editing, you press enter and the proc will be defined with your new
code.

After a long day of debugging, you can use "info body hello" and you
will get the body of your proc hello printed to the screen ready for
copy-paste.

The commands you use on tkcon commandline are also available from the
tclsh command line (but there you do not have such nice history
functions etc.)

One thing that I haven't tried is to load the tkcon code in the NC-Sim
environment. If that is possible then tkcon should be able to see the
NC-Sim specific modules. tkcon is a tcl application so it should be
able to run with any tcl interpreter. You would need to change the #!
or exec call at the beginning of tkcon.

I haven't tested this so I am not sure if it works.

>
> PS, IMHO, I like Perl more than Tcl :)
>

As a Tool Command Language I think Tcl is better than Perl. It simply
has something to do with the close relationship to the unix command
line where you first have a command and then a bunch of option switches
and then some arguments. Knowing Tcl make it a bit easier to live with
SKILL (Cadence Tool command Lisp). Rest is personal taste and a lot has
to do with how easy it is to integrate the interpreters into your
c-code. Tcl was made for this, I don't know about Perl.

--
Svenn

From: mark anthony on
Davy wrote:
> Hi all,
>
> I use NC-Sim Tcl command (like "stop") and found Tcl script is
> white-space sensitive. And I have to wait for the Tcl report error in
> run time and time-consuming. Can I debug/lint the Tcl script before run
> all the simulation? Thanks!
>
> Or is there something like Perl's "use strict" and "use warnings" in
> Tcl? That I can write robust Tcl file in NC-Sim.


though i dont use nc-sim but what works for me is to create
a test file that checks automated atleast new procs with a
certain set of cases that could happen and execute the test
via make for each unmature module. if i have a simple mispell
or something it raises the error.

hope this is applicable

From: Andreas Leitgeb on
Peter Spjuth <peter.spjuth(a)space.se> wrote:
> Andreas Leitgeb wrote:
>> PS: (PostScriptum, but also addressed to Peter Spjuth :-)
>> lately I failed getting nagelfar to accept version 8.5 stuff
>> (which I think to remember worked previously) - I definitely
>> start nagelfar.tcl with tclsh8.5) e.g.: {expand}.. and lassign
> Did you generate a database from an 8.5 interpreter?

Meanwhile I did, and it worked (no longer complained about
8.5-features).

In a way it's still a bit clumsy, because it searches for the
syntax-db in the current directory, unless I give the option
with full path.

I have now written a wrapper script, that passes the extra
option (with full path to syntaxdb-file) to nagelfar, and
that works, but it would be even better, if it worked
without having to explicitly deal with syntaxfiles.

Thanks anyway for the great work!