Page 2 of 3 <123>
Topic Options
#110868 - 2004-01-09 09:32 AM Re: 4.5 alpha
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Quote:

rich, nope...
have to disagree on that one.

example tokenization of:
$foo="bar"
$bar="test"
$=Execute('"The value of $$$$'+$foo+' is "+$$'+$foo+' ?')

should lead to something like:
$1="bar"
$2="test"
$3=Execute('"The value of $$$$'+$1+' is "+$$'+$1+' ?')







Lonk, look again at the example and you will see why tokenising variables names is a problem.

I'll bet you didn't try to execute your sample tokenised code, did you?

The tokenised code returns:
Code:
The value of $bar is


When of course the script should be returning:
Code:
The value of $bar is test


Top
#110869 - 2004-01-09 09:54 AM Re: 4.5 alpha
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Quote:

what comes to called scripts, if they are to share same namespace, they will have same names.




No, when it comes to tokenised names that is not correct.

Ok, consider two very simple scripts:

S1.KIX
Code:
Global $sApple, $sOrange

$sApple="Apple"
$sOrange="Orange"

Call S2.kix



S2.KIX
Code:
Global $sPear, $sOrange, $sApple

"Value of $$sPear is '"+$sPear+"'" ?
"Value of $$sOrange is '"+$sOrange+"'" ?
"Value of $$sApple is '"+$sApple+"'" ?



Run these and you get what you'd expect:
Quote:

Value of $sPear is ''
Value of $sOrange is 'Orange'
Value of $sApple is 'Apple'




Now, tokenise the variables:
S1.KIX
Code:
Global $1, $2

$1="Apple"
$2="Orange"

Call S2.kix



S2.KIX
Code:
Global $1, $2, $3

"Value of $$sPear is '"+$1+"'" ?
"Value of $$sOrange is '"+$2+"'" ?
"Value of $$sApple is '"+$3+"'" ?



Now when you run the scripts, you will get an incorrect result:

Quote:

Value of $sPear is 'Apple'
Value of $sOrange is 'Orange'
Value of $sApple is ''




These are contrived examples, but you can easily see why variable names must be preserved in tokenised code.

Top
#110870 - 2004-01-09 01:19 PM Re: 4.5 alpha
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22333
Loc: OK
k, now I get what you mean.
but what I'm after would not allow this.

if script is to be tokenized, either it's called subs are included (ey, we still don't have include statement in kix) or they are tokenized too.

and once got here, we need to get include in keywords if call is not gonna handle that.
_________________________
!

download KiXnet

Top
#110871 - 2004-01-09 01:40 PM Re: 4.5 alpha
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22333
Loc: OK
think I need to give example, of both ways in my head.
using your initial scripts.
btw, isn't there double declaration in your script?
so much time when I last coded... can't remember how these go

now, if tokenizing and having call and ruud makes call work as include, results is like:
Code:
 Global $1, $2
$1="Apple"
$2="Orange"
Global $3, $2, $1
"Value of $$sPear is '"+$3+"'" ?
"Value of $$sOrange is '"+$2+"'" ?
"Value of $$sApple is '"+$1+"'" ?



when not using include, the result might be:
S1.kx
Code:
 ] Global $1, $2
$1="Apple"
$2="Orange"
call "s2.kx"



s2.kx
Code:
 
Global $3, $2, $1
"Value of $$sPear is '"+$3+"'" ?
"Value of $$sOrange is '"+$2+"'" ?
"Value of $$sApple is '"+$1+"'" ?



anyway, looking at your code's var declarations, it seems that it shouldn't work anyways...
_________________________
!

download KiXnet

Top
#110872 - 2004-01-09 01:54 PM Re: 4.5 alpha
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Quote:

or they are tokenized too



The code has to be monolithic - individually tokenised scripts will have the same problem.

If all subscripts are included in-line before tokenisation and you never need to expand variable names (variable-variables, indirection, Execute statements) then you could probably tokenise variable names, although I might have missed something.

I knew there was something else nagging me - the following will not work with tokenised variable names:
Code:
kix32.exe $sMyDomain="ACME" tokenised.kx



IMO the loss of these and other features far outweighs the very minor gains that tokenising variable names would give.

Perhaps tokenisation of variables names could be a tokeniser option for hardcore golfers

Reducing variable names to single character can be handled by a pre-parser, if that is all that is required.

Top
#110873 - 2004-01-09 01:59 PM Re: 4.5 alpha
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22333
Loc: OK
the commandline var input is pretty outdated already.
now we got one more reason to get rid of it.

if we finally would get our hands to the full commandline via macro or so, this would be no problem and we could FINALLY introduce more "standard" switches in there with slashes and all.

anyway, indeed the difference is not huge but lets take as an example a simple compiler.
there you can choose a optimization of speed, size etc...
here both of above would be gained and nothing really lost.
_________________________
!

download KiXnet

Top
#110874 - 2004-01-09 03:38 PM Re: 4.5 alpha
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
I am against tokenizing variables, too. Dynamically created variables are also used in KiXforms GUIs in addition to heavy use of EXECUTE(). KiXforms scripts should be tokenizable as well.
_________________________
There are two types of vessels, submarines and targets.

Top
#110875 - 2004-01-09 03:46 PM Re: 4.5 alpha
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

I think var names should also be converted to tokens for best performance.




OK, will admit it was a bit of a brain fart. Did not think it through. Still, have to wonder (BF Alert) if Execute() could be pre-parsed for var names.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110876 - 2004-01-09 04:05 PM Re: 4.5 alpha
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Quote:

OK, will admit it was a bit of a brain fart. Did not think it through. Still, have to wonder (BF Alert) if Execute() could be pre-parsed for var names.




The quick answer is "no".

The long answer is that Execute() statements have to be parsed at run-time. You cannot substantiate a variable until it has a value, and it does not have a value unless the code is executing.

In the case of the example I gave the value of the (indirectly referenced) variable is constant as it is a very simple example. In a more complex example the variable name may be constantly changing.

Top
#110877 - 2004-01-24 01:12 PM Re: 4.5 alpha
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22333
Loc: OK
k, nice observation for you all.
I just tokenized my first script.

in my own handwriting the size was amazing 4,30K
when tokenized, the size came to 4,66K!

now, talk about down-sizing.
I bet that this thing is gonna make all my scripts lot bigger.
_________________________
!

download KiXnet

Top
#110878 - 2004-03-19 08:45 AM Re: 4.5 alpha
Balu Offline
Lurker

Registered: 2004-03-19
Posts: 1
First sorry for deviating from the main subject.

I am a user of the KiXtart version 4.22, I want to test and use KiXtart that supports the tokenizing functionality. Can anyone point me to the place where I can get the build that supports this feature?

Or do I have to mail anybody in obtaining it?

Thanks for your help,
Bala

Top
#110879 - 2004-03-19 08:52 AM Re: 4.5 alpha
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11569
Loc: CA
Hello Balu and welcome to the board.

At this time I don't think you can get it. Ruud asked that we not post or host it. I do think that he will be releasing a public beta in the near future.

I recieved email from him a couple of weeks ago and he is very busy at his normal job. supporting includes in this new version is proving to be a little more difficult for supporting the debug information, but hopefully it won't be too long before we see an update.

Keep an eye on on the board.

Top
#110880 - 2004-04-01 12:54 PM Re: 4.5 alpha
Ruud van Velsen Offline
Developer
*****

Registered: 1999-05-06
Posts: 359
Loc: Amsterdam, The Netherlands
If you would like to test the latest Alpha build, please send me a direct email.

Kind regards,

Ruud

Top
#110881 - 2004-04-01 12:57 PM Re: 4.5 alpha
Ruud van Velsen Offline
Developer
*****

Registered: 1999-05-06
Posts: 359
Loc: Amsterdam, The Netherlands
Just to let all of you know that I've sent out a second Alpha release of KiXtart 4.50.

Depending on the feedback on this release, a public beta will be available in May/June.

Kind regards,

Ruud

Top
#110882 - 2004-04-01 03:35 PM Re: 4.5 alpha
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
KiXtart 2010 ???

Very Clever, no more worries for the next 6 years
_________________________



Top
#110883 - 2004-04-01 04:29 PM Re: 4.5 alpha
Ruud van Velsen Offline
Developer
*****

Registered: 1999-05-06
Posts: 359
Loc: Amsterdam, The Netherlands
I'm sure you can guess what the next version will be called....
Top
#110884 - 2004-04-01 05:02 PM Re: 4.5 alpha
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
ummm,

KiXtart 2061, right ?
_________________________



Top
#110885 - 2004-04-01 05:07 PM Re: 4.5 alpha
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
So, where's the secret HAL easter egg? Can't find anything. Even using HAL or HAL2000 doesn't produce anything inside the script.
_________________________
There are two types of vessels, submarines and targets.

Top
#110886 - 2004-04-01 06:03 PM Re: 4.5 alpha
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I'm still scratching my head over this 2010 thingy ... saw the movie and know about the HAL thingy but is that really the thingy ?
Top
#110887 - 2004-04-01 08:56 PM Re: 4.5 alpha
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11569
Loc: CA
KiXtart Odyssey
Top
Page 2 of 3 <123>


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 159 anonymous users online.
Newest Members
emnipetro, Hirze, thequeen, ameliaryan, shalomsalami
17641 Registered Users

Generated in 0.04 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.