Sunday, January 1, 2017

Digest for comp.lang.c++@googlegroups.com - 8 updates in 5 topics

ram@zedat.fu-berlin.de (Stefan Ram): Jan 01 07:23PM

>I still had to answer to this.
>MFC uses message maps, which substantially work, but they are buried
>within MFC, so they come with all of its burden (which Alf summarized well).
 
Since I asked this, I feel obliged to answer something,
but I can add little to what you and others already wrote.
 
One idea would be to try to clearly split the program into
two parts: The majority of the program is written in modern
C++ and excludes the topic of message cracking.
 
Then there is a separatedly compiled part that only deals
with the topic of message cracking and calling into the
interface of the rest of the program. This part is allowed
to use any "dirty tricks" that make the life of the programmer
easier (wizards, preprocessors, MFC, obsolete programming
style).
 
So, the idea is: When there has to be some "dirt" in a
program, it should be isolated from the rest of the program.
ram@zedat.fu-berlin.de (Stefan Ram): Jan 01 11:23PM

Newsgroups: comp.lang.lisp,comp.lang.c++
 
>There probably should be a separate Value class, which has all those
>types in it. Because a value can be in a symbol, cons cell, array
>element, etc., not just in a symbol.
 
When I read the OP, I thought: How would I do this?
So I started to write my own LISP interpreter in C++.
 
Five minutes later, I thought: This is taking *way too long*!
So I stopped.
 
Here's what I got so far (written before I read your
response):
 
#include <vector>
#include <string>
 
struct cons
{ struct entry * car;
struct entry * cdr; };
 
struct entry
{ union
{ cons cons;
::std::string text; };
int type;
bool mark = false;
bool used; };
 
struct assignment
{ ::std::string name;
struct entry * value; };
 
struct heap
{ ::std::vector< entry >heap;
::std::vector< assignment >assignments;
 
mark()
{ /* for each assignment
mark its value and recursively the car and cdr */
}
 
sweep()
{ /* for each entry
if it is not marked, then set it free
set mark = false */ }
 
allocate()
{ /* find free entry, if none, grow vector */ }
 
cons()
{ /* return new cons */ }
 
string()
{ /* return new string */ } };

int main() { }
 
The idea was this: I expected the hardest part for me to be
garbage collection, because I have no experience with
writing a garbage collector. So, I thought should start to
write and debug this first.
 
The OP multiposted, I changed it into a crosspost.
 
Newsgroups: comp.lang.lisp,comp.lang.c++
woodbrian77@gmail.com: Jan 01 02:42PM -0800

On Friday, December 30, 2016 at 6:51:41 PM UTC-6, Alf P. Steinbach wrote:
> in the Holy Standard use prefix `const`. The more general notation is
> needed for pointer and function declarations.
 
> For the general notation pointer declaration, just read it backwards. :)
 
Right-to-left is forwards for Arabic, Hebrew and some other languages.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
Paavo Helde <myfirstname@osa.pri.ee>: Jan 01 08:31PM +0200

On 31.12.2016 19:34, Manfred wrote:
> the handler function. Microsoft has gone to considerable extent in
> optimizing such lookup, but still every single message has to go through
> them.
 
MFC could have used virtual functions instead of message maps. However,
they decided to go with message maps which are more compact in memory
than vtables (this was in the 16-bit era). Message maps might be a bit
slower, but in a GUI framework this is not important because the user is
not able to generate the events very rapidly.
 
The resulting macro mess is the direct result. At the same time MFC is
using virtual functions as well, which does not make things better.
 
> From the coding point of view, it is a minor issue but I find it
> somewhat suboptimal that a handler for a single message has to be
> declared twice: in the class and in the map.
 
I think the idea was that one should use the Visual Studio wizards which
were supposed to generate all pieces for the event handler in one go.
However, I recall the wizards had massive problems with namespaces and
generally ceased to work in non-trivial projects.
Jerry Stuckle <jstucklex@attglobal.net>: Jan 01 04:18PM -0500

On 1/1/2017 1:31 PM, Paavo Helde wrote:
> than vtables (this was in the 16-bit era). Message maps might be a bit
> slower, but in a GUI framework this is not important because the user is
> not able to generate the events very rapidly.
 
It does use virtual functions - but it still requires a message map.
 
> The resulting macro mess is the direct result. At the same time MFC is
> using virtual functions as well, which does not make things better.
 
The message maps are required as a result of how Windows message
handling works. Remember - C++ is not the only language used with Windows.
 
> were supposed to generate all pieces for the event handler in one go.
> However, I recall the wizards had massive problems with namespaces and
> generally ceased to work in non-trivial projects.
 
I've used it in some very large projects, even before namespaces were
commonly used. It's all in how you structure your program.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Dec 31 09:25PM -0800

Go to learn about how to be forgiven for your sin, and to pass
from death (because of sin) to life (eternal life, spiritual
life).
 
Christianity is not a religion. It's a relationship with Jesus
Christ. In that relationship, He changes you in a way other
things can't change you. He changes your insides, your heart,
your mind, understanding, outlook, viewpoint, focus. He
breathes life into your existence, making all things new.
 
It is the born again nature, a down payment of the full promise
of eternal life. Its presence electrifies your existence, so
amazibg that until it happens you can't believe it until it
happens to you.
 
Best regards,
Rick C. Hodgin
Mr Flibble <flibble@i42.co.uk>: Jan 01 02:15PM

On 01/01/2017 05:25, Rick C. Hodgin wrote:
> Go to learn about how to be forgiven for your sin, and to pass
> from death (because of sin) to life (eternal life, spiritual
> life).
 
No evidence for an afterlife detected.
 
> things can't change you. He changes your insides, your heart,
> your mind, understanding, outlook, viewpoint, focus. He
> breathes life into your existence, making all things new.
 
Of course Christianity is a religion and a provably false one at that:
as we know evolution is true the Bible must be false. Anything
predicated on the Bible being true is also false. The Abrahamic god is
false. Jesus Christ never existed. Your religion (Christianity) is a lie
so perhaps you should look for another one or turn to atheism.
 
> of eternal life. Its presence electrifies your existence, so
> amazibg that until it happens you can't believe it until it
> happens to you.
 
Word salad.
 
As to going to church this Sunday: FUCK OFF YOU OBTUSE OFF TOPIC CUNT.
 
/Flibble
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 01 12:13AM

On Sat, 2016-12-31, Ian Darroy wrote:
 
> I'm writing a small lisp interpreter and it consists of few classes:
> Reader, Evaluator, Environment, Symbol and Function. My design is
> bad because hardly all classes depend on each other this way:
 
I don't know your problem well, but IMO a design doesn't have to be
bad because of interdependencies. Does this design threaten your
actual project?
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: