Re: stoooopid bilge



Dear rst:

"rst" <release_willy@xxxxxxxxxx> wrote in message
news:1120515783.759993.294700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> N:dlzc D:aol T:com (dlzc) wrote:
>> Dear Big Crunch:

I finally got this reference (along with Don Giovanni) to Robert
Aspirin's "Myth " series...

>> "Big Crunch" <relativity@xxxxxxxxxxxx> wrote in message
>> news:1120492651.849394.94440@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> >
>> >
>> > N:dlzc D:aol T:com (dlzc) wrote:
>> >> Dear rst:
>> >>
>> >> "rst" <release_willy@xxxxxxxxxx> wrote in message
>> >> news:1120476053.917461.80160@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> >> >
>> >> > N:dlzc D:aol T:com (dlzc) wrote:
>> >> >> Dear Big Crunch:
>> >> >>
>> >> >> "Big Crunch" <relativity@xxxxxxxxxxxx> wrote in message
>> >> >> news:1120397230.993108.218090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> >> >> ...
>> >> >> >> No. It does _exactly_ what david smith stated
>> >> >> >> - when the routine is main(). Look it up in K&R.
>> >> >> >> What K&R writes regarding the way exit()
>> >> >> >> is implemented is almost what what mr. smith
>> >> >> >> wrote almost verbatim.
>> >> >> >
>> >> >> > no you fool, mister smith tried to save your but
>> >> >> > becus you are unable to rationate, you fooool
>> >> >> >
>> >> >> > you declare a function retrurning a int, which
>> >> >> > can be either 2 bytes or 4 bytes longt etc
>> >> >> > depending on the enviroments etc
>> >> >> >
>> >> >> > then you cheat the compiler and yourself by
>> >> >> > not returnig the damn int, but calling a
>> >> >> > function "exit()", introducing overheads by
>> >> >> > pushin bull*** on stack, allocating memory
>> >> >> > for local vars etc etc....you fool
>> >> >>
>> >> >> If you look at the code snippet that Bilge
>> >> >> actually supplied, he supplied "exit(0)".
>> >> >> What you are wailing at is his discussion
>> >> >> of the function/operator "exit()".
>> >> >
>> >> > its a function, not an operator
>> >>
>> >> Consider that it is a "function" that is called
>> >> by the program that it *doesn't* return a value to.
>> >
>> > it is a function called with a parameter
>>
>> A function returns a value to the calling program.
>
> no, usually they returns, if any, to the calling function
>
> no again, a function dont need to return anything, just
> executing
>
> there are a lot of
>
> void function(void)
>
> outthere

Good point. Ugly, but allowed.

>> The calling
>> program in the case of "exit(##)" is the operating system,
>
> no, is the function main, declared explicit by bilge to return
> an int
>
> int main(...)

"main" returns to the operating system (or code that invoked this
code as a child), so the "exit" is a single-valued "return"
statement (along with its other duties).

>> and
>> not the code that contains the exit(##).
>
> you are totally confussed,
> abviously you know so much as nothen about
> lexical / parsers, tokens, optimisation theories etc,
> including, lets say, at least twice as much mathematics
> then relativity

I wrote my own language, and coded p-code for it by hand for 12
years. You are missing the points raised. So I will let it
drop.

>> It looks like a
>> function, but it doesn't act like any other function in C.
>
> haha, you are nice
> if it looks, the parser might decode token exit(0) as
> being a function call, does it have other alternatives?

"return 0" has already been presented. This allows the compiler
to discern where the intentional program termination is supposed
to be, and link in the necessary "exit" code. Or just leave it
up to the opsys to kill, which is at least sloppy...

>> >> It seems more like an
>> >> operator to me.
>> >
>> > fortunately functions are functions not what they appear
>> > to you
>>
>> I suspect you are now only posting to pick a fight...
>
> you are a nice person, why should i do that?

Motivations are not mine to decipher. I can *imagine* a few
"whys"...

>> > operator on what?
>>
>> Resources and the return value ultimately received by the
>> operating system.
>
> operator on resources!? this is somthin very new for me

Memory is allocated. IO "file" handles are assigned. Resources
are "leased" in some sense. The exit function is required to
release those resources (stack, explict memory, etc.) to the
opsys.

> apparently there will be someone pretending the same, but
> the operating system dont need an explicit return value from an
> exiting process

Most mature operating systems have been designed to find and kill
child processes. But not all children can be found. It is bad
practice to not terminate the children raised, if they are not
intentional TSR.

> the "0" value returned from bilges rampant code is there just
> for him, informing other eventually processes / scripts
> releasing
> the code
>
> its say for instance, if "0" then the code has been executed
> completly

The meaning of a single-valued return requires a "lookup table".
"0" could easily represent a failure to find a file, that the
program terminated without errors, or that the user interface
requested menu option 0.

>> > are you sure you understand what operators and
>> > operands are?
>>
>> The purpose pf the exit statement is to *operate* on
>> resources,
>> and return *nothing* (not even execution) to the program that
>> contains the invocation of "exit(##)". Is "return" a
>> function?
>
> no, is a directive to compiler
>
> functions can have more then one input variables / parameters,
> usually being standard typedef variables or pointers to objects
> and bigger data structures

Procedures or subroutines (in other languages) can all have
multiple parameters. "exit" cannot be so overloaded, and still
work.

>> Functions *have* returns..
>
> not necesary, but you are right in this case, bilge should
> return an int, not terminating the process by calling a
> function

It is inherent in the language, namely C. Even Clipper (a
variant of dBase) uses either return (as a statement), or exit
(as a statement) to terminate a program. And you can simply "run
off the end" of the code, and terminate that way as well. And
Clipper 5.2 has null functions (no meaningful return value) in
place of many program statements.

Just because it has a parameter list surrounded by parenthesis,
doesn't mean it is a function. How about if()? Is this a
function, or simply a program control structure? It doesn't
return a value... Will you complain about its proper use?

I have no issues with exit NOT being a function, even though it
has a parameter "list" surrounded by parentheses. Any code after
it, but still within "main" will never execute. "exit" never
returns a value to the code that contains it. It simply passes a
value to "the next lower level".

David A. Smith


.


Quantcast