[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Scripting in KDE
From:       Jono Bacon <f9808590 () wlv ! ac ! uk>
Date:       2001-01-07 16:59:12
[Download RAW message or body]

Hello all,

Although so far the discussion has covered everyones opinions on the best
language, I feel the direction of this thread may have shifted. Personally I
feel the user should have access to any language to script in...but there
should be standard KDE and application specific syntax which can be used to
simplify things. As an example lets say I want to use kppp at 6am to
automatically start, dial the 'MyConn' connection, run the kde-build script
from kdesdk and then disconnect. I script to do this could be around the lines
of:

   StartScript
   when(SystemTime = (6, am)
	StartProg(kppp)
	kpppConnect("myConn")
	StartProg("/sources/kdesdk/scripts/kde-build", theScript)

	when(theScript = finished)
		kpppDisconnect("myConn")
   EndScript

In that snippet of code you can see it resembles a simple script using my
imaginary language, but it also contains some keywords:

	StartScript
	SystemTime
	am
	StartProg
	finished
	EndScript

These keywords could be defined in the kdelibs, but then the application
developer of kppp could also define his/her own keywords:

	kpppConnect
	kpppDisconnect

Using this system the user could use any language for their script and use
these specfic keywords in both the kdelibs and the application.

We could then implement into th script support in KDE a compiler similer to moc
which converts these symbols into the native languages code (the language that
a user can select).

An example of the above script using C++ as a scripting language (!) could be:

   StartScript
   if(SystemTime = (6, am) {
	StartProg(kppp);
	kpppConnect("myConn");
	StartProg("/sources/kdesdk/scripts/kde-build", theScript);

	if(theScript = finished);
		kpppDisconnect("myConn")
   EndScript

I am by no means an author of programming languages, so please forgive my
errors that I have no doubt made, but I am sure you can understand my concept.

	Jono
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic