Topic: dynamic code [addendum]


Author: danielgutson@hotmail.com (danielgutson@hotmail.com)
Date: Sun, 25 Jan 2004 20:02:36 +0000 (UTC)
Raw View
kuyper@wizard.net (James Kuyper) wrote in message
[addendum to my prev. message]

If we   d add the usage of a syntactic help for this purpose -as I   ve
just shown in the previous message- then the compiler would be able to
check -and forbid- the reference to function-external symbols.
Example:

[keeping the sample using    auto   ]

auto int f(void)
{
   int x = g(1);   // error
   return x;
}

----C++ specific----
Getting just a little into C++, classes declared inside an auto
function (or method, but don   t mess with this yet), would be packaged
together as well:

auto int f(void)
{
  class Solver
  {
  public:
      int method()
      { return 1+1; }
  } s;

  return s.method() + 1;
}

then: sizeof(*f) would include f   s bytecode and Solver   s methods as
well, and the bytecode generation will be together.

  Daniel.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]