Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-04

Script Language, TCL Update

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Johann Glaser

Hi!

I want to equip a program with a command line and plan to use a real scripting language to interpret the user input. I've looked around a bit (e.g. in the mailing list archives) and found some languages:
- PascalScript
- JavaScript
- Lua
- TCL

Only the latter has a "command line friendly" syntax, i.e. the parameters are entered separated by spaces, like for the shell.

So far, could you recommend me any other "command line friendly" language?

After that, my second point. Happily, FreePascal comes with a TCL package, but this is linked to TCL 8.0, while 8.5 is the current version. Did anybody update the unit? Is anybody interested in an updated unit? Would you include it to the official FreePascal distribution if I send an updated unit?

Thanks
Hansi

Reply by email

Marcos Douglas
to Johann Glaser
Johann Glaser wrote 21 lines
Hi! I want to equip a program with a command line and plan to use a real scripting language to interpret the user input. I've looked around a bit (e.g. in the mailing list archives) and found some languages:  - PascalScript  - JavaScript  - Lua  - TCL Only the latter has a "command line friendly" syntax, i.e. the parameters are entered separated by spaces, like for the shell. So far, could you recommend me any other "command line friendly" language? After that, my second point. Happily, FreePascal comes with a TCL package, but this is linked to TCL 8.0, while 8.5 is the current version. Did anybody update the unit? Is anybody interested in an updated unit? Would you include it to the official FreePascal distribution if I send an updated unit?

I think Lua is more simpler and powerfull.

Marcos Douglas

Reply by email

Johann Glaser
to Johann Glaser: Hi! I want to equip a program with a command line and plan to use a real scripting…

Hi!

Johann Glaser wrote 5 lines
After that, my second point. Happily, FreePascal comes with a TCL package, but this is linked to TCL 8.0, while 8.5 is the current version. Did anybody update the unit? Is anybody interested in an updated unit? Would you include it to the official FreePascal distribution if I send an updated unit?

I investigated the C header files of TCL 8.0 and 8.5 and found them quite different. Therefore I've created totally new TCL 8.5 header translations. Please find attached the files.

Additionally I've started a little OOP wrapper for the interpreter. I'm not quite sure whether it is so helpful to wrap all the functions, so only a few are there.

The IMHO interesting part is a OOP wrapper to create custom data types (TCL calls this "object types") for custom commands. It is tested and provides a very clean interface to make your class type a TCL object type. Please find attached some examples.

Could interested people please have a look at the sources and give me feedback and suggestions for improvements? When everything is polished I'd be happy if it is included in the official FreePascal sources.

Thanks
Hansi

Reply by email