Re: Adding the ability to add functions into structures?



Chuck F. wrote:
Walter Roberson wrote:

Albert <albert.xtheunknown0@xxxxxxxxx> wrote:

So structures are useful to group variables, so you can to
refer to a collection as a single entity. Wouldn't it be
useful to also have the ability to collect variable and
functions?


Are there any problems with adding the ability to have
functions encapsulated in structures?


structures are data, functions are code. Having the ability to
store functions (instead of function -pointers-) into structures
would require mechanisms by which data become executable. Some architectures (e.g., the Harvard architecture) cannot do that.


In architectures that do allow it, you would allow -all- of your
data to be executable (in which case you have all of the classic
stack overflow problems) or else you need a mechanism to
-dynamically- indicate that a particular block of memory is executable; the existance of such a dynamic method is not at all
certain on any particular system.


Methinks the OP wants lisp.

Methinks too much credit you offer to the OP.

--ag

--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com (new post 8/5)
http://www.cafepress.com/goldsays
"If you have nothing to hide, you're not trying!"
.



Relevant Pages

  • Re: Adding the ability to add functions into structures?
    ... Wouldn't it be useful to also have the ability to collect variable and functions? ... would require mechanisms by which data become executable. ... the Harvard architecture) cannot do that. ... "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. ...
    (comp.lang.c)
  • Re: What are "security implications" of FTP chroot jails?
    ... There are a number of _relatively_ simple mechanisms to break out of ... jail - and this becomes easier when they have the ability to grab software ...
    (comp.os.linux.security)
  • Adding the ability to add functions into structures?
    ... So structures are useful to group variables, so you can to refer to a ... collection as a single entity. ... Are there any problems with adding the ability to have functions ...
    (comp.lang.c)
  • Re: Moving to the Net: Encrypted Execution for User Code on a Hosting Site
    ... want the goodness of the mechanisms we are discussing - the ability to detect reliably if software you have not approved has been installed on your system, the ability to protect yourself against malware being isntalled across the net, or, as in this newstring, the ability to run programs securely on remote machines - then, unfortunately, such identification seems to be necessary. ... that can install any needed updates & patches, otherwise it will become a way to take over said computer. ...
    (comp.arch)