Newsgroups: comp.lang.python,comp.lang.tcl,comp.lang.scheme,comp.lang.misc
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!pipex!sunic!trane.uninett.no!eunet.no!nuug!dkuug!news.uni-c.dk!diku!juul
From: juul@diku.dk (Anders Juul Munch)
Subject: Re: What language would you use?
Message-ID: <Cywno0.8zn@odin.diku.dk>
Sender: juul@embla.diku.dk
Date: Mon, 7 Nov 1994 16:12:00 GMT
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
References: <39b7ha$j9v@zeno.nscf.org> <39bhda$cuf@agate.berkeley.edu> <39cian$28f@larry.rice.edu> <KLM.94Nov4153430@coil.nist.gov> <39heio$k8b@csnews.cs.Colorado.EDU>
Mime-Version: 1.0
Organization: Department of Computer Science, U of Copenhagen
X-Newsreader: NN version 6.5.0 #12 (NOV)
Lines: 57
Xref: glinda.oz.cs.cmu.edu comp.lang.python:2612 comp.lang.tcl:21764 comp.lang.scheme:11221 comp.lang.misc:19092

Tom Christiansen <tchrist@mox.perl.com> writes:

>:-> In comp.lang.tcl, ken.manheimer@nist.gov writes:
>: - My sense of perl is that it has just about the most elaborate
>:   syntax imaginable.  

>You have a very limited imagination when it comes to the 
>inscrutable. :-)  Just go look at apl or fornax to see what 
>I mean.  

>Take a look at what follows.  It is really that unintellible, expecially
>compared to lisp/scheme or to tcl?  I guess it depends on where you're
>coming from.  Why don't you consider three scenarios: folks from a a C and
>sh background, folks from a Basic background, and folks from a Fortran +
>Rexx background, just for example.

Exactly which one of these groups do you expect to find perl code readable?

Not the BASIC crowd, I guess, nor Fortran or Rexx programmers.  Then it must
be the C and sh hackers, which includes me.  But even though well-commented,
this following line of perl code made as much sense to me as line noise:

>	    ### change the last part after the slash to "man"
>	    $man_component =~ s/[^\/+]*$/man/;


I think you need to know perl or at least sed to understand that.  I
consulted the perl man page and figured it out, and here's the same code as
I would have written it: 

	= man_component {BEFORE / {man_component}}/man

This is using a shell/scripting language that presently exists on my
machine only, but in Scheme it would look something like this:

	(set! man_component (concat-string (before "/" man_component) "/man"))

The `before' function returns the prefix of a string (here: man_component)
upto a given substring (here: "/").  A very useful function when
manipulating filenames, together with it's almost-complement `after'.

>If you just aren't use to reading regular expressions, like

>	    /^References:.*(<[^>]+>\n?$)/ 

>you'll just have get used to it, because most languages these
>days support them one way or the other.

You think so?  But then you will certainly want to encapsulate the cryptic
regexps in higher-level string-manipulating function such as `before'.  Can
you write such a function in Perl?  If you can, is it common coding style to
do so?  I get the impression it is not.


Anders Munch            |  Department of Computer Science
juul@diku.dk            |  University of Copenhagen, Denmark
Still confused but at a higher level
