Re: What is the Result from Invoking this Halt Function?
From: Joe Hendrix (jhendrix_at_uiuc.edu)
Date: 08/18/04
- Next message: Peter Olcott: "Re: What is the Result from Invoking this Halt Function?"
- Previous message: >parr\(*>: "Re: What is the Result from Invoking this Halt Function?"
- In reply to: Marc Goodman: "Re: What is the Result from Invoking this Halt Function?"
- Next in thread: Marc Goodman: "Re: What is the Result from Invoking this Halt Function?"
- Reply: Marc Goodman: "Re: What is the Result from Invoking this Halt Function?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 17 Aug 2004 18:34:49 -0500
Marc Goodman wrote:
> Joe Hendrix wrote:
>> Marc Goodman wrote:
>>>Please explain again why the below working code does not refute your
>>>statement that "[for standardized C] there is no way for a program
^^^^^
>>>to inspect its own code."
>>>
>>> return(((int *)func)[19]);
>>
>> ^
>> In standard C (C90, C99), you can't typecast a function pointer into a
>> value pointer much less dereference the result, the behavior is
>> undefined in the standard and compiler/architecture specific.
>
> It's merely an example of a single instance of a program
> that conditionalizes its behavior based on whether it returns
> a result or not.
>
> As an example, it works on my dual-processor Athlon box running
> RedHat Linux. It proves such a think is _possible_.
>
> It doesn't have to be standard C to be possible.
You are redefining your claim. You claimed that code proved that
reflection was possible in standard C (by reflection I mean the ability
of a program to inspect it's own code at runtime). I merely pointed out
that your example was not Standard C, so it is not a counterexample.
Obviously, there are languages that support reflection (Java, Lisp,
Prolog, plus many more), but I suspect that Standard C is not one of
them and in fact was intentionally designed not to support reflection.
Since any programming language I know supporting reflection is provably
Turing complete (ignoring resource limits), I don't think this affects
the halting problem, but that's not really a subject I'm going to post
anything (else) about.
- Next message: Peter Olcott: "Re: What is the Result from Invoking this Halt Function?"
- Previous message: >parr\(*>: "Re: What is the Result from Invoking this Halt Function?"
- In reply to: Marc Goodman: "Re: What is the Result from Invoking this Halt Function?"
- Next in thread: Marc Goodman: "Re: What is the Result from Invoking this Halt Function?"
- Reply: Marc Goodman: "Re: What is the Result from Invoking this Halt Function?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|