[7922] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1547 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 29 15:07:27 1997

Date: Mon, 29 Dec 97 12:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 29 Dec 1997     Volume: 8 Number: 1547

Today's topics:
     Re: calling two arrays in a function as variables (M.J.T. Guy)
     Re: Correct syntax for length function? (M.J.T. Guy)
     directory tree take_five@hotmail.com
     Re: directory tree (M.J.T. Guy)
     Re: HELP! using a while statement (M.J.T. Guy)
     Re: How to get unique list value <joseph@5sigma.com>
     Re: How would you do this... <reibert@mystech.com>
     Re: Printing EOT? (Jim Littlefield)
     Re: Programmer needed <joseph@5sigma.com>
     Re: question about syntax (Mike Stok)
     Re: SelfLoader doesn't recognize =pod/=cut (M.J.T. Guy)
     Shortcut(s) to perl scripts bomb <sjenifer@isc.mds.lmco.com>
     Re: Sorting files (Tad McClellan)
     Re: taint (M.J.T. Guy)
     Re: Which language pays most? Smalltalk, not  C++ nor J (Kaz Kylheku)
     Re: Which language pays most? Smalltalk, not C++ nor Ja (Lawrence Kirby)
     Re: Which language pays most? Smalltalk, not C++ nor Ja (Billy Chambless)
     Re: Which language pays most? Smalltalk, not C++ nor Ja (Robert Dewar)
     Re: Which language pays most? Smalltalk, not C++ nor Ja <gschwarz@its.cl>
     Re: Which language pays most? Smalltalk, not C++ nor Ja (Kaz Kylheku)
     Re: Which language pays most? Smalltalk, not C++ nor Ja (Kaz Kylheku)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 29 Dec 1997 19:14:09 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: calling two arrays in a function as variables
Message-Id: <688sq1$9pm$1@lyra.csx.cam.ac.uk>

David Corcoran  <david.x.corcoran@boeing.com> wrote:
>
>Note:
>	I don't know if the syntax:
>
>		@{$_[0]}
>
>	is a hard or soft reference (I haven't dealt with references enough)
>
>	if it is a soft reference then you can't use the 'strict' pragma as
>	perl forbids it.

That's a hard reference in this case, since $_[0] is a reference to
an array.    If the value of $_[0] was a string, you'd have a soft
reference (more properly called a symbolic reference).

See perlref for details.


Mike Guy


------------------------------

Date: 29 Dec 1997 19:04:07 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Correct syntax for length function?
Message-Id: <688s77$9if$1@lyra.csx.cam.ac.uk>

Greg Zevin <greg@turing.une.edu.au> wrote:
>
>Moreover, you could write something like:
>
>if ( !$firstname ) {&incomplete1};   etc..

But don't do that if there's any possibility that $firstname could be
the string "0".

Much safer to encourage people to do explicit tests for '', or test
length().


Mike Guy


------------------------------

Date: Mon, 29 Dec 1997 13:01:33 -0600
From: take_five@hotmail.com
Subject: directory tree
Message-Id: <883421366.872022020@dejanews.com>

Does anyone have a snippet of perl coding that will create a list of
subdirectories under a given directory (walk the directory tree)?

Thanks.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


------------------------------

Date: 29 Dec 1997 19:16:19 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: directory tree
Message-Id: <688su3$9q3$1@lyra.csx.cam.ac.uk>

In article <883421366.872022020@dejanews.com>,  <take_five@hotmail.com> wrote:
>Does anyone have a snippet of perl coding that will create a list of
>subdirectories under a given directory (walk the directory tree)?

Investigate the File::Find module, either to use directly or as a sample
of code.


Mike Guy


------------------------------

Date: 29 Dec 1997 18:56:23 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: HELP! using a while statement
Message-Id: <688ron$9a8$1@lyra.csx.cam.ac.uk>

Inet Admin  <inet.admin@bridge.bellsouth.com> wrote:
>
>____chomp($yeah);_____
>
># This chomp removes any triling whitespace character from you input. In this
>case, the \n
># character, which is foiling your eq compare at the start of the while loop.

Not quite.   chomp only removes the $/ character (\n by default).   It
never removes any other whitespace character.


Mike Guy


------------------------------

Date: Mon, 29 Dec 1997 11:03:32 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: How to get unique list value
Message-Id: <34A7E5F3.19E7B8A5@5sigma.com>

OK, OK, "named-temporary-free."  :-)

Mike Stok wrote:
> 
> In article <34A70EC6.6B39F196@5sigma.com>,
> Joseph N. Hall <joseph@5sigma.com> wrote:
> >Here's the grep-free, temporary-free version from my book:
> >
> >  @uniq = sort keys %{ { map { $_, 1 } @list } }
> 
> Yes, but surely there is an anonymous temporary hash in there?


------------------------------

Date: Mon, 29 Dec 1997 11:28:15 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: How would you do this...
Message-Id: <34A7EBBE.4643BC7E@mystech.com>

Sorrow wrote:

> I'm running a perl script on a text file where each line
> looks like this:
>
> LINENUM=DATA1 <space> DATA2 <space> DATA3 <newline>
>
> and what it is supposed to do is sort the information
> in the original text file based on DATA2 and write it
> out to a new, sorted, text file.
> The following is what I came up with.
> I'm very new to perl and I'm certain that I am doing
> things the hard way.  By seeing how any of you would
> have done this task, it lets me learn from my mistakes.
>
> while(<>) {
>   s/[^\.]+=//;
>   @info = split( /\s/, $_ );
>   if( $info[1] == 1 ) {
>     push( @goodlist, join( ' ', $info[0], $info[1], $info[2] ));
>   } else {
>     push( @badlist, join( ' ', $info[0], $info[1], $info[2] ));
>   }
> }
> open( OUTFILE, ">nbsort.txt" ) || die( $! );
> foreach $infoline (@goodlist) {
>   print OUTFILE "$infoline\n";
> }
> foreach $infoline (@badlist) {
>   print OUTFILE "$infoline\n";
> }
> close( OUTFILE );

Hmmm, sounds like everyone is missing the value of a hash! How 'bout this:

%info = ();
while ( <> ) {
  my $key = split( /\s+/, $_ )[1];
  $info{$key} = $_;
}
open( OUTFILE, ">nbsort.txt" ) || die( $! );
foreach $key ( sort keys %info ) {
  print OUTFILE $info{$key};
}
close( OUTFILE );

-----------------------------
   Mark S. Reibert, Ph.D.

  Mystech Associates, Inc.
  3233 East Brookwood Court
   Phoenix, Arizona 85044

    Tel: (602) 732-3752
    Fax: (602) 706-5120
 E-mail: reibert@mystech.com
-----------------------------




------------------------------

Date: 29 Dec 97 17:45:35 GMT
From: little@ragnarok.hks.com (Jim Littlefield)
Subject: Re: Printing EOT?
Message-Id: <slrn6afodv.f4q.little@ragnarok.hks.com>

On Mon, 29 Dec 1997 11:02:00 -0600, Wade Williams <wwilliam@cisco.com> wrote:
>I've looked through all the documentation and I've been unable to find an
>answer to this one.
>
>How does one print special characters such as EOT (control-d)?
>
>I've opened sendmail with the "ignore periods" option:
>
>  open(MAIL,"|/usr/lib/sendmail -ti") 
>
>and I need to send a EOT to indicated the end of the message.  How can I
>do it?

close(MAIL);

--
Jim Littlefield             "Everyone has a photographic memory. Some
                             don't have film." - Steven Wright



------------------------------

Date: Mon, 29 Dec 1997 11:05:13 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Programmer needed
Message-Id: <34A7E658.A828638F@5sigma.com>

It's not every day you find a post that is an instant classic.

	-joseph
	 http://www.effectiveperl.com

Vladimir Geshanov wrote:
> 
> Hey there!
> 
> Need some perl script. Description is attached in txt format.


------------------------------

Date: 29 Dec 1997 12:49:38 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: question about syntax
Message-Id: <688nri$14f$1@stok.co.uk>

In article <688ks1$krc$1@news2.cais.com>, Sorrow <cboget@apdi.net> wrote:
>I was reading the perlfunc manpage and came across
>the following:
>
>@articles = sort {$a cmp $b} @files;
>
>what is the {} doing?  I believe I know what the curly
>brackets are used for, but the above doesn't fit.

They're delimiting a block.  In the perfunc documentation:

       sort SUBNAME LIST

       sort BLOCK LIST

       sort LIST
               Sorts the LIST and returns the sorted list value.
               If SUBNAME or BLOCK is omitted, sorts in standard
               string comparison order.  If SUBNAME is specified,
               it gives the name of a subroutine that returns an
               integer less than, equal to, or greater than 0,
               depending on how the elements of the array are to
               be ordered. [...]
                                                      [...] In
               place of a SUBNAME, you can provide a BLOCK as an
               anonymous, in-line sort subroutine.


>Also, I saw this snippet of code in a message:
>
>map{"@$_\n"}
>sort{$a->[1]<=>$b[1]}
>
>where is the $a and $b coming from?  (those are
>the first 2 lines of the code, so the $a and $b aren't
>being declared or set up in any way prior to the
>sort line).

Later in sort's perlfunc docs:

               In the interests of efficiency the normal calling
               code for subroutines is bypassed, with the
               following effects: the subroutine may not be a
               recursive subroutine, and the two elements to be
               compared are passed into the subroutine not via @_
               but as the package global variables $a and $b (see
               example below).  They are passed by reference, so
               don't modify $a and $b.  And don't try to declare
               them as lexicals either.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


------------------------------

Date: 29 Dec 1997 18:59:35 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: SelfLoader doesn't recognize =pod/=cut
Message-Id: <688run$9ag$1@lyra.csx.cam.ac.uk>

Brett Denner  <Brett.W.Denner@lmco.com> wrote:
>I've successfully been using the =pod/=cut technique to comment out sections
>of code.  I recently started using the SelfLoader module to speed up speed up
>compilation, but have discovered that apparantly in some cases when using
>SelfLoader =pod/=cut don't work properly.
>
>Am I doing something wrong, or is this a bug in SelfLoader?

It's a bug (or perhaps undocumented feature) in SelfLoader.
SelfLoader has very naive ideas about Perl syntax.    In particular,
it doesn't recognise the =pod mechanism.


Mike Guy


------------------------------

Date: Mon, 29 Dec 1997 13:28:31 -0500
From: Shade Lawrence Jenifer <sjenifer@isc.mds.lmco.com>
Subject: Shortcut(s) to perl scripts bomb
Message-Id: <34A7EBCF.4C70@isc.mds.lmco.com>

hello Perl gang.

i need a quick response on this; kudos in advance to
the one who helps me...

i've got MIIS 2.0 running on an NT 4.0 workstation; the web
server is configured to handle cgi scripts and looks in the
'Scripts' (actually an alias to 'scripts') directory to find them.
as a test, i created a comment form with which included a line
like this:

<form ... method="post" action="http://...../Scripts/test.pl">

the test.pl script just prints the text the user typed in the
form's comment field.  as long as the text.pl file physically resides
in the directory aliased by 'Scripts', i get the expected results.
this same test.pl also resides in another directory.  so, as a test,
i deleted ../Scripts/test.pl, then i went to the directory where the
other test.pl was, created a shortcut to it, and moved that shortcut to
'Scripts'.  after renaming the shortcut to 'test.pl', i thought i
would get the same results.  however, when i submitted the comment,
i got an error stating that http://.../Scripts/test.pl could not be
found.

ANY helpful (and prompt) feedback is greatly appreciated - even
if it's a request for clarification on this problem.  Thanks!

Shade L. Jenifer
shade@isc.mds.lmco.com


------------------------------

Date: Mon, 29 Dec 1997 12:01:25 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Sorting files
Message-Id: <lho886.vj1.ln@localhost>

John Porter (jdporter@min.net) wrote:
: Randal Schwartz wrote:
: > Now, if it's more than about 20 names or so, you should step up to
: > a Schwartzian Transform (or some other technique).  See examples
: > of this in my "sorting" column from UnixReview at:
: > 
: >         http://www.stonehenge.com/merlyn/UnixReview/

: Randal,
: I looked at this file (col06.html), and found no mention of anything
: called a Schwartzian (or any other kind of) Transform.
: What technique specifically did you mean to refer to by this name?


grep 'Schwartzian Transform' *.pod

finds three matches in the PODs that come with the perl distribution.
(perlfaq4, perlfunc, and perllol)


examples with each.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 29 Dec 1997 18:40:39 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: taint
Message-Id: <688qr7$8re$1@lyra.csx.cam.ac.uk>

Gustav Kristoffer Ek <stoffer@netcetera.dk> wrote:
>I got the error: Insecure $ENV{ENV} while running with -T switch... when
>running the following three lines, it seams to be a litle strange since I
>use $ENV{PATH} = "/bin:/usr/bin";
>
>#! /usr/bin/perl -Tw
>$ENV{PATH} = "/bin:/usr/bin";
>open (whoisHandle, "/usr/bin/whois|") or die "Can't open whois. $!";
>
>how can I make'em secure?

Same way you make $ENV{PATH} secure  -  set it to a safe value, for
example

  $ENV{ENV} = '';


Mike Guy


------------------------------

Date: 29 Dec 1997 19:30:26 GMT
From: bill@cafe.net (Kaz Kylheku)
Subject: Re: Which language pays most? Smalltalk, not  C++ nor Java.
Message-Id: <688toi$j1r$1@brie.direct.ca>

In article <34A50CAA.54AA@netup.cl>,
Guillermo Schwarz  <gschwarz@netup.cl> wrote:
>Kaz Kylheku wrote:
>> Although 'memcpy' is not a reserved keyword by any means,
>> it is a reserved 'external name'. 
>It is the first time I see reserved external.

The second time may come when you actually read the standard.

>> A strictly conforming program may not define any external
>> name that begins with 'mem' followed by any combination of letters,
>> digits or underscores. 
>Ok. Define void memfoo() { } and see if it compiles.
>It does.

You clearly have no idea about what distinguishes a language definition
from a language implementation.

Of course the definition of memfoo compiles! But a future version of the C
language may add memfoo to the standard library, at which point your program
might not compile. An existing implementation may also define its own
memfoo, knowing that a strictly conforming C program won't use such
an identifier as an external name.

>> Define memcpy, if you write such a static function, you must not 
>> include the <string.h> header in
>> the same translation unit, else undefined behavior results.
>Wrong. The compiler points out two different implementations.
>The executable can't be generated.

That is a possible consequence of undefined behavior, yes. On many systems,
however, you _can_ in fact write your own version of a standard function
with external linkage. The result is that your program, and all libraries
it is linked to, use the new function. That is another possible
consequence of undefined behavior.

If the standard required the implementation to fail to make an executable,
it would not be undefined behavior.

>> There is no such thing as ``overriding'' in C. Each external name must
>> have exactly one definition if it is used anywhere in the program.
>That's true. C is not object oriented. C++ is just an Smalltalk
>wannabe.

I wasn't talking about overriding methods in an ancestor class, but a physical
overriding of external names at link time! This capability C++ does not have
either; it has the One Definition Rule (ODR).


------------------------------

Date: Mon, 29 Dec 97 14:52:22 GMT
From: fred@genesis.demon.co.uk (Lawrence Kirby)
Subject: Re: Which language pays most? Smalltalk, not C++ nor Java.
Message-Id: <883407142snz@genesis.demon.co.uk>

In article <34A7B45C.403B@min.net> jdporter@min.net "John Porter" writes:

>Robert Dewar wrote:
>> OK, so your compiler can compile memfoo without compiling. Wunderbar! But
>> that does NOT mean that you can actually go ahead and call a routine memfoo
>> if the standard forbids it. To do so would be incompetent programming.
>
>So now a "language" is not defined by the compiler -- or even by the
>preprocessor+compiler+linker+etc, as some have it...

They may very well define a language but they certainly don't define the
C language.

>I am forbidden by a piece of paper from calling a function 'memfoo'!

You can't declare/define memfoo as an identifier with external linkage if
you are writing C code. That is because the standard permits compilers to
use it for their own purposes. If you want to use it with your particular
compiler because you "know" it works then nobody is going to stop you.
However any real guarantees you have that it will work are tenuous at best
and all bets are off from a portability perspective. It may be more
obvious when you consider functions like strdup() or strupr(). The
same considerations apply except that some compilers are actually known to
define these functions. Perhaps the nastiest header in this respect is
<ctype.h> which reserves identifiers starting with is and to (followed by
a lowercase letter). So names like issue and token are reserved.

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------



------------------------------

Date: 29 Dec 1997 17:56:28 GMT
From: billy@cast.msstate.edu (Billy Chambless)
Subject: Re: Which language pays most? Smalltalk, not C++ nor Java.
Message-Id: <688o8c$mab$2@nntp.msstate.edu>

In article <01bd147e$11496760$6a28b4cf@carla.ici.net>, "Alicia Carla Longstreet" <carla@ici.net> writes:
|> John Porter wrote:
  
|> : So now a "language" is not defined by the compiler -- or even by the
|> : preprocessor+compiler+linker+etc, as some have it...
|> : I am forbidden by a piece of paper from calling a function 'memfoo'!
 
|> No the language is *not* defined by any single compiler, neither is it
|> defined by any piece of paper.  A language is defined by usage.  A
|> combination of compilers and the standard.

mmmm.... well, I'd say the standard defines a lot of what the compilers
may and may not do. 

ISO defines ISO C, Borland defines Borland C etc....

|> The ISO Standard defines the core of the language.  Any C compiler *must*
|> support this common core, but it may also support various extensions to
 
|> Similarly the ANSI/ISO Standard is a snapshot of the common core of the C
|> language.  The language itself continues to grow and evolve.  Actually C9X
|> recognizes this but preparing a new 'snapshot' of the language (or at least
|> the core).

I don't think that's exactly right. It seems that some of the proposded
changes aren't really part of existing practice... but I'll shut up and
wait for committee members and people who have beed tracking the draft
to comment on that.

|> The standard is needed to keep the language balance.  To keep it from
|> changing out of control.  It is always an 'after the fact' situation.

No, there's more to the standards process than codifying existing
practice. Somewhere I have an article by Tom Plum where he says that
it was *mumble* months after C89 was ratified before even one compiler
passed the Plum Hall validation suite -- a suite of tests that verified
how well the compiler complied with the standard. I'm sure that somebody
who was closer to the action is  reading this, and can comment.


------------------------------

Date: 29 Dec 1997 13:07:14 -0500
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Which language pays most? Smalltalk, not C++ nor Java.
Message-Id: <dewar.883418599@merv>

John says

<<So now a "language" is not defined by the compiler -- or even by the
preprocessor+compiler+linker+etc, as some have it...
I am forbidden by a piece of paper from calling a function 'memfoo'!

John Porter
jporter@logicon.com
>>

Of course the answer is that the language is defined by the standard. What
is surprising is your exclamation mark at the end of a statement that should
be common understanding for any programmer.

Of course the language is not defined by the compiler, or any combination
of tools. This is nothing new, languages have been defined by standards
for a very long time. C came rather late to the standards business, but
even before the ANSI C standard was approved, C was defined by pieces
of paper, including for example the reference manual at the back of K&R.

For anyone to think that a language is usefully defined by a compiler is
to me evidence of poor training. No one should be able to get out of any
CS degree program with this kind of misconception.

However, as I said in my earlier message, I am afraid that this confusion
is a very common one and is responsible for a huge percentage of the problems
in porting code, regardless of the language.

If your only knowledge of the definition of a language comes from what you
find is accepted by your compiler, you can be sure that your code is unlikely
to be anywhere as near portable as it should be.




------------------------------

Date: Mon, 29 Dec 1997 16:15:37 -0500
From: Guillermo Schwarz <gschwarz@its.cl>
Subject: Re: Which language pays most? Smalltalk, not C++ nor Java.
Message-Id: <34A812F9.C169A703@its.cl>

This is a multi-part message in MIME format.
--------------0D39F4D1D23D0DD734DA6601
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



Kurt Watzka wrote:

> Guillermo Schwarz <gschwarz@netup.cl> writes:
>
> >Kaz Kylheku wrote:
> >> Although 'memcpy' is not a reserved keyword by any means,
> >> it is a reserved 'external name'.
> >It is the first time I see reserved external.
>
> Well, looks as if there still is something to learn about C for you.
> The exact wording is "are reserved as identifiers with external
> linkage", but "reserved external name" looks close enough to me.
>

It's nice to know C advances so fast I can't keep up to date with its
definition."Reserved as identifiers" is something meaningful to you? Can you
reserve a name as
a non indentifier?
"with external linkage"? Those are too many words just to mean an extrernal
name.
The point is, at least when I studied the good and old K&R, it didn't mention

"reserved as identifiers with external linkage", that for me means "don't
touch this,
or trick"... The C guys modify their language each 3 months just when they
realize
something is missing. If you think it is funny, I think it is pretty messy.

In Smalltalk, there is USUALLY no need to change the language, but just the
need
to add new classes and methods to achieve what's needed.

> If memcpy is not defined as a function with external linkage, and
> if <string.h> is not included, an implementation that does not
> sucessfully translate the program in question is at error. Did
> you actually _try_ it, and if yes, which implementation did
> "point out two different implementations"?

You are right! I'm amazed. GNU gcc does implement memcpy directly (what is to
say thatmemcpy is inlined into the resulting exe, independently from how it
is defined
in the program).

I would like to follow the only faith: smallTalk, so that my flesh doesn't
get rotten.

How can somebody have a life, if the ANSI  is changing the language so fast?
They think that by changing minor things they can keep C alive?
(I'm not meaning C is dead, but let Electronic Engineers do the drivers for
their
HW in C, but don't tell the rest of the world C is the right language because
it
is well implemented or something else wrong like that).

Maybe not too much people write their dirvers in Smalltalk because the
drivers
are very simple pieces of code. Drivers have no complex algorithms, they just

need sti(), cli(). That's why drivers are made in C. That's why drivers were
made
in assembly.

> The object model and design ideas behind C++ are completely different
> from Smalltalk.

Objects have behavior and state in both languages.C doesn't have objects, nor
behavior, nor state.
C++ is backward compatible with C.
----------------------------------------
C++ is a Smalltalk wannabe (at least an OOL wannabe).

> You could probably call C++ a Simula wannabe (If you
> are prepared to call a Mustang a Modell T wannabe)

Oops! It seems a C++ defender is here. You think C++ is fast as a mustang?At
least a Model T is not as fast as a Mustang, but C is usually faster than C++
unless
the coder is at least 3 years experience.
Model T is more like Simula, very old, very good for their time. Now they
wouldn't sell.
Mercedes is more like Smalltalk. Well designed. Strong. Fast. Everything in
it is a pleasure.
Fiat 600 is more like C++. Old desing. Poor. Pieces doesn't fit. Nothing in
it is beautiful.
Shopping Cart is more like C. You must do everything by hand. Walking is the
only way to
move it. Put two people in it, and they will be discussing all the time. Be
careful or you can
drop to the floor very easily and get your mouth red with your own blood. Or
what's worse,
your body can become a corpse dump.

> , but calling
> it a Smalltalk wannabe indicates that you either don't know Smalltalk
> or you don't know C++.

I'm sorry to hurt your feelings about C++. But it turns out that C++ is a
very poorlanguage. You can't know how many bits does an int have. Or if long
is actually bigger
than int. You can't ask an structure how many fields does it have. You can't
tell an
structure to write itself into a file. You can't code an algorithm that works
with any
kind of numbers: int, double, big int, etc.
In C++ there is no way to handle overflow of integers.
Ask in runtime how many classes do you have in your image.
Or try to figure out which classes descend from which.
Try to make a single general program.
Try to create a Set of objects in C++.
Try to create a Bag of objects in C++.
Try to create a SortedCollection of objects in C++.
Convert one collection into another. (SortedCollection as Bag or whatever).
Put a Set inside another Set.
Try to create a Dictionary of pairs of objects in C++ using hashing to index
the keys.
Then put a Dictionary and a Set inside a Dictionary with the Dictionary as
the key.
If you can do a single thing of what I wrote here you are a good C++
programmer.
All this can be done in 10 minutes in Smalltalk (if lazy).

I'm sorry if I hurt your feelings, but for the last 3 months I've been
Smalltalking more than
keeping up with the C crap. (C++ being the cream of the crap and Java being
coffe you
drink with cream).

I mean no offense to other languages. Fortran had its time. C had it. C++ had
it. Java is having it.
Smalltalk deserves a little respect as the king of OOL. (Maybe CLOS guys will
not agree with
me), but trying to say that C++ object model is better than Smalltalk object
model is saying
GW BASIC is more structured than Pascal. And claiming you know C++ and
Smalltalk more
than me is something to prove, sir!

--------------0D39F4D1D23D0DD734DA6601
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Guillermo  Schwarz
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Guillermo  Schwarz
n:              Schwarz;Guillermo 
org:            ITS
email;internet: gschwarz@its.cl
title:          Software Engineer
note:           Remove stop.spam to reply by mail.
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------0D39F4D1D23D0DD734DA6601--



------------------------------

Date: 29 Dec 1997 19:35:06 GMT
From: bill@cafe.net (Kaz Kylheku)
Subject: Re: Which language pays most? Smalltalk, not C++ nor Java.
Message-Id: <688u1a$j7d$1@brie.direct.ca>

In article <34A7B45C.403B@min.net>, John Porter  <jdporter@min.net> wrote:
>Robert Dewar wrote:
>> OK, so your compiler can compile memfoo without compiling. Wunderbar! But
>> that does NOT mean that you can actually go ahead and call a routine memfoo
>> if the standard forbids it. To do so would be incompetent programming.
>
>So now a "language" is not defined by the compiler -- or even by the
>preprocessor+compiler+linker+etc, as some have it...
>I am forbidden by a piece of paper from calling a function 'memfoo'!

That piece of paper, as you say, doesn't forbid any such thing! It merely
states that all bets are off if you do that, because the identifier
belongs to a reserved name space. 

What is important is not what the paper forbids, but what it allows!
It allows an actual implementation to forbid you from calling an
external function by a reserved name. What's worse, it allows an
implementation to behave unpredictably.

Go ahead! Break the rules! Ignore the paper! You will look foolish in the end.  


------------------------------

Date: 29 Dec 1997 19:40:05 GMT
From: bill@cafe.net (Kaz Kylheku)
Subject: Re: Which language pays most? Smalltalk, not C++ nor Java.
Message-Id: <688ual$jem$1@brie.direct.ca>

In article <685mee$5d4$1@sparcserver.lrz-muenchen.de>,
Kurt Watzka <watzka@stat.uni-muenchen.de> wrote:
>Guillermo Schwarz <gschwarz@netup.cl> writes:
>
>>Kaz Kylheku wrote:
>>> Although 'memcpy' is not a reserved keyword by any means,
>>> it is a reserved 'external name'. 
>>It is the first time I see reserved external.
>
>Well, looks as if there still is something to learn about C for you.
>The exact wording is "are reserved as identifiers with external
>linkage", but "reserved external name" looks close enough to me.

The first occurence of ``external name'' appears in italics in the standard.
It is formally defined as having the same meaning as ``name with external
linkage''; to say that something is reserved as an external name is
*precisely* the same as saying that it is reserved as an identifier with
external linkage, not merely ``close enough''.

:))


------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1547
**************************************

home help back first fref pref prev next nref lref last post