DragonFly BSD
DragonFly kernel List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: learning dragonfly or C...

From: "George Georgalis" <george@xxxxxxxxx>
Date: Fri, 12 Nov 2004 10:39:10 -0500

On Fri, Nov 12, 2004 at 01:28:46AM +0100, Jonas Sundstr?m wrote:
>Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx> wrote:
>> :>	struct fubar * blah;
>> :>	struct fubar *nblah;
>> :>
>> :>	getmafubar(&nblah);
>> :>	blah = nblah;
> ...
>>     Nope.  Ok, I'll tell you... it's so the compiler can 
>>     optimize 'blah' into a register.
>Cool discussion, though this a much later issue for
>most coders, let alone those just starting to learn C.

I'm really glad to get a dose of advanced topics. Even if they are beyond
what I am ready to apply or even comprehend, exposure to the difficult
stuff orients my attention in the direction of the things I still have
to learn, giving an opportunity to prepare for a time that I'm ready to
learn.  From book 3 of Michel de Montaigne's essays, chapter 13

    THERE IS no desire more naturall then that of knowledge. We attempt
    all meanes that may bring us unto it. When reason failes us, we
    employ experience.

    Per varios usus artem experientia fecit,
    [Manilius, I, 59]

I'm partial to the Penguin translation: By various experiments, experience
has led us to art, example showing the way.  An online version is here

I really didn't grasp recursion when I studied Pascal, but since I got
exposure back then, I was able to figure it out in an afternoon, last
year, when I wrote this bash function for making ptr addresses from ip:

arpa () {
[ -z $1 ] && echo -n An ip address on the command line returns its\ 
rev=`echo $1 | cut -d\. -f1`.$2;ip=`echo $1 | cut -d\. -f2-`
[ "$ip" = "$1" ] && echo ${rev}in-addr.arpa || $FUNCNAME $ip $rev ;}

It is unfortunate that Matt took my question for plagiarism of his code,
I can imagine how that unfolded and I'm glad he responded so I could
clarify. Hopefully any misunderstanding is already put aside. I did spend
a lot of time focusing that question, and I find all the responses, really
valuable. They frame (and develop!) nicely the direction I had a vague
notion I was headed in, controlling variable namespace in C. But first, I
need some time to really soak up the answers to my last question! :-)

// George

George Georgalis, systems architect, administrator Linux BSD IXOYE
http://galis.org/george/ cell:646-331-2027 mailto:george@xxxxxxxxx

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]