Page 2 of 2 <12
Topic Options
#101496 - 2003-05-26 09:57 AM Re: BUG: KiXtart 4.21
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm ... I missed that somehow.

So using :
code:
 exit () 

or even
code:
 quit () 

for the last year or so could prove out to be not only 'good' practice but may also get 'syntactically correct' somewhen [Wink]

[ 26. May 2003, 09:59: Message edited by: Jochen ]
_________________________



Top
#101497 - 2003-05-26 01:11 PM Re: BUG: KiXtart 4.21
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it indeed is not even close of good practise.

as long as exit is command and I bet quit will never be anything else, it does not matter do you specify brackets.

it's just like doing:
code:
for $counter=(1) to (5)
...
next

if that counts as good or even smart, I must be dumb.
_________________________
!

download KiXnet

Top
#101498 - 2003-05-26 01:53 PM Re: BUG: KiXtart 4.21
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Right you are ,

I'd like to take back 'good' and replace that with 'Incorrect-but-working-anyway'

[Roll Eyes]
_________________________



Top
#101499 - 2003-05-27 10:27 AM Re: BUG: KiXtart 4.21
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
An interesting discussion, which comes up regularly.

"Quit" and "Exit" having an optional parameter are just one of those KiXtart oddities like the functions which don't return a value.

I guess they are there because of historical reasons, perhaps due to trying to follow batch file conventions.

Because KiXtart is a free format language, there is only one situation when it is acceptable (or at least reliable) for Quit or Exit to have no parameter, and that is when it is the last token in the file.

If you use Quit or Exit anywhere else in a file without a parameter you can expect to get bitten by it occasionally.

I disagree with formalising the use of parentheses after Quit or Exit. This would imply a function, which they clearly are not - they are commands.

A far simpler (and better IMO) option is simply to update the manual and make the parameter mandatory. While there will be cases when you are not interested in the exit status, I cannot think of any reason why you would want not to set an exit status.

It's current status as "it is sort of optional, sometimes, when it works" is not helpful to anyone.

[ 27. May 2003, 10:28: Message edited by: Richard H. ]

Top
#101500 - 2003-05-27 11:05 AM Re: BUG: KiXtart 4.21
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
good preach!
although that it works when you use it in such place... like before another commands...

but, anyway, yes... it's more of confusing kind than easing.
and indeed making it mandatory would reduce the confusion amount. not just for starters.
_________________________
!

download KiXnet

Top
#101501 - 2003-05-27 01:16 PM Re: BUG: KiXtart 4.21
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I love it when everyone has an opinion. [Cool]

Can't wait to find the next item that will raise some passion.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.143 seconds in which 0.083 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org