[6709] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 334 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 21 09:07:14 1997

Date: Mon, 21 Apr 97 06:00:28 -0700
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, 21 Apr 1997     Volume: 8 Number: 334

Today's topics:
     [Q] Chat server in perl <wells@cs.utk.edu>
     Re: a question on striping characters (Nathan V. Patwardhan)
     Re: Command Line (Michael Constant)
     Re: Creating New Files (ALASTAIR AITKEN CLMS)
     Re: debugger and fork() (Ilya Zakharevich)
     Re: Delete List Element (Mike Stok)
     Re: evaluating an expression <rfi@uebemc.siemens.de>
     Re: evaluating an expression (David Alan Black)
     Re: Good editor for W95? (Petr Prikryl)
     Help with Filehandles (Philip Tanner)
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th (Chris Bitmead uid(x22068))
     Re: order of 'keys' and 'values' (Michael Constant)
     Re: Ousterhout and Tcl lost the plot with latest paper (Ulric Eriksson)
     Perl & ADO - anyone got a GOOD example? <rtremble@ctissrv1.plt.ford.com>
     Re: PERL Editor (Tad McClellan)
     Re: Plans for DB_File for Berkeley DB 2.0? (Paul Marquess)
     Re: read string from file (ALASTAIR AITKEN CLMS)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Gary D. Duzan)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Chris Bitmead uid(x22068))
     Re: Scripting vs. Systems (Daniel Wang)
     Universal scripting interfaces (Was: Ousterhout and Tcl (Mike Meyer)
     What does  ^=  assignment op. do?? <jong@mrc-lmb.cam.ac.uk>
     What does ^= operator do?? <jong@mrc-lmb.cam.ac.uk>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 20 Apr 1997 21:32:36 -0400
From: Elton Wells <wells@cs.utk.edu>
Subject: [Q] Chat server in perl
Message-Id: <335AC3B4.4800@cs.utk.edu>

Hi,

I am wanting to write a server similar to the one in the
pink Camel book (pg. 344).  However, instead of having the
clients connect to the server and the client sending messages
that are echoed back on the server, I would like the client
to send a message and have it echoed on the screens of all
the clients.  So, basically, I want it to work like a chat
server (ala IRC).  The problem that I am running into is that
when the server forks the child doesn't know about the other
clients.  Is there some way that the server can communicate with
the children or is there some other way to set up the server in
the described fashion?  Thanks.

Elton Wells
wells@cs.utk.edu


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

Date: 21 Apr 1997 01:03:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: a question on striping characters
Message-Id: <5jeecr$ga8@fridge-nf0.shore.net>


spanky@direct.ca wrote:

: how can you strip the character string, Ex ->  "I_LIKE_THE_NUMBER_9"
: to get just the number 9?

perl -e '$val="I_LIKE_THE_NUMBER_9"; $val=~s/\D//g; print $val,"\n";'

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 21 Apr 1997 03:05:47 -0700
From: mconst@soda.CSUA.Berkeley.EDU (Michael Constant)
Subject: Re: Command Line
Message-Id: <5jfe5r$pml@soda.CSUA.Berkeley.EDU>

In article <E8uoDz.FM7@nonexistent.com>, Abigail <abigail@fnx.com> wrote:
>But note that `here documents' work with -e too!
>
>perl -w -e "use strict"; \
>        -e "print <<EOF;" \
>        -e "The main problem is that once a script" \
>        -e "takes more than one line, entering and editing" \
>        -e "are not worth the trouble. You should store it" \
>        -e "in a file at that point.\n\nHope this helps! :-)" \
>        -e "EOF"

As do literal "newlines" in quotes:

    perl -we "use strict; print '" \
	 -e "The main problem is that once a bunch of perl" \
	 -e "hackers start trying to prove how much can be" \
	 -e "done with -e, the examples start to get silly." \
	 -e "'"
-- 
        Michael Constant (mconst@soda.csua.berkeley.edu)


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

Date: 21 Apr 1997 11:28:20 GMT
From: zpalastair@unl.ac.uk (ALASTAIR AITKEN CLMS)
Subject: Re: Creating New Files
Message-Id: <5jfj0k$fp8@epsilon.qmw.ac.uk>

In article <3357CB72.23F7@mail.cheta.net>, "Kevin A. Miller" <kmiller@mail.cheta.net> writes:
>I am trying to create a script that opens a single .dat file, which
>consists of array elements
>(some_name,some_address,phone_number,CATEGORY), 'Four fields seperated
>by commas'.  I then want the program to take whatever element is in the
>CATEGORY part and create a new .dat file with each CATEGORY as the name
>of the new file, then print the whole array in this new file.

#! /usr/local/bin/perl

require 5.003;
use Strict;

my (%categories, @rec, $category); # does my have an implicit undef?

#	set up a hash (associative array), one item for each category:

open (IN, "/path/to/largefile.dat")
while ( <IN> ) {
    @rec = split(',',$_);
    if ($categories{$rec[3]}) {
	$categories{$rec[3]} .= "\n$rec[0],$rec[1],$rec[2]";
    } else {
	$hash{$rec[3]} = "$rec[0],$rec[1],$rec[2]";
    }
}

#	print out the hash items one by one to new .dat files

close (IN);
foreach $category (keys(%categories)) {
    $file = $category . ".dat";
    open (OUT, "> $file");
    print OUT $categories{$category};
    close (OUT);
}

exit 0;

Alastair.


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

Date: 21 Apr 1997 01:14:18 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: debugger and fork()
Message-Id: <5jef1a$dnn$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Malcolm Beattie
<mbeattie@sable.ox.ac.uk>],
who wrote in article <5jcub9$skd@news.ox.ac.uk>:

> >5.  What about debugging?
> 
> That might depend greatly on the platform unless somebody manages to
> do something clever with ther perl debugger.

By the way, is there anyone who wants to use perl debugger across
fork()?  I have some ideas how to (simply) make it workable.

When this works, and threads are here, we can try to generalize it to
threads. 

Ilya


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

Date: 21 Apr 1997 12:03:51 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Delete List Element
Message-Id: <5jfl37$3rr@news-central.tiac.net>

In article <335B3DAF.54D@ozinter.co.jp>,
christop@ozinter.co.jp <christop@ozinter.co.jp> wrote:
>It took a while but my next question for the wise has appeared:
>
>If I have (an) %array that looks like this:
>
>row1=>[1,2,3,4],
>row2=>[5,6,7,8]
>
>and I want to delete row2; do I say
>
>delete($array{'row1'})

surely that would be delete $array{row2};  If you run perl's debugger bu
saying

  perl -de 1

then you can try and see what is happening:

  DB<1> %array = (row1=>[1,2,3,4],row2=>[5,6,7,8])

  DB<2> X array
%array = (
   'row1' => ARRAY(0x80506a0)
      0  1
      1  2
      2  3
      3  4
   'row2' => ARRAY(0x80fb204)
      0  5
      1  6
      2  7
      3  8
)
  DB<3> delete $array{row2}

  DB<4> X array
%array = (
   'row1' => ARRAY(0x80506a0)
      0  1
      1  2
      2  3
      3  4
)

Make sure that you're using at least the -w flag in case there is some
hard to see mistake in the script, and if possible use the

  use strict;

pragma.

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@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 21 Apr 1997 11:15:59 +0200
From: Ronald Fischer <rfi@uebemc.siemens.de>
Subject: Re: evaluating an expression
Message-Id: <xz2hgh0enxs.fsf@uebemc.siemens.de>

>>>>> On 20 Apr 1997 21:27:37 GMT
>>>>> "Stephan" == Stephan Nagy <steph@ciris.net> wrote:
Stephan> how do i evaluate an expression to see if it is divisible by a number. or
Stephan> in other words.
Stephan> 
Stephan> if ( (sumnumber/4) == a whole number) {
sumnumber%4 == 0
-- 
Ronald Otto Valentin Fischer (PGP public key available on request)
business:	ronald.fischer@uebemc.siemens.de
private:	ronald.fischer@acm.org
http://ourworld.compuserve.com/homepages/ronald_fischer/


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

Date: 20 Apr 1997 23:52:49 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: evaluating an expression
Message-Id: <5jea8h$og5@pirate.shu.edu>

"Stephan Nagy" <steph@ciris.net> writes:

>There is probably a simple solution to this, but i can't figure it out.

>how do i evaluate an expression to see if it is divisible by a number. or
>in other words.

>if ( (sumnumber/4) == a whole number) {
>	@DaysInMonth=31,29,31,30,31,30,31,31,30,31,30,31
>}
>elsif ((sumnumber/4) != a whole number) {
>	@DaysInMonth=31,28,31,30,31,30,31,31,30,31,30,31
>}

>can i do this?  if so how?  any assistance is appreciated.

Use the modulus operator:

if ( $number % 4) {  it isn't a multiple of 4 }
else  { it is }

(See Camel, p. 82.)

So if only leap year calculation were free of all weirdities, you 
could do:

@DaysInMonth = (31, ($year%4? 28:29), 31, 30, 31, 30,
                31, 31, 30, 31, 30, 31);

But you can't.  :-)

Depending exactly what you are doing, you might want to check some
of the date manipulation modules at CPAN.

David Black
dblack@icarus.shu.edu



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

Date: 21 Apr 1997 11:42:15 GMT
From: prikryl@dcse.fee.vutbr.cz (Petr Prikryl)
Subject: Re: Good editor for W95?
Message-Id: <5jfjqn$c69$2@boco.fee.vutbr.cz>


Benjamin Burack (rascal@inlink.com) wrote:
>I'm writing CGI scripts in perl on my W95 machine, and then uploading
>them to the Unix server.  I'm looking for recommendations on good
>editors that can easily save in a Unix format.

Try http://space.mit.edu/~davis/jed.html

If you start to edit UNIX file in it in DOS/Windows, then it will
remain UNIXish after save. Similarly, when you start to edit DOS
file in UNIX, it will remain DOSish. 

You may not like the basic emacs mode (which is really very good),
but you can switch it to brief, wordstar, vi,...

Petr 

--
Petr Prikryl (prikryl@dcse.fee.vutbr.cz)   http://www.fee.vutbr.cz/~prikryl/
TU of Brno, Dept. of Computer Sci. & Engineering;    tel. +420-(0)5-7275 218


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

Date: 21 Apr 1997 11:19:14 GMT
From: ptanner@doom.sw.stratus.com (Philip Tanner)
Subject: Help with Filehandles
Message-Id: <5jfifi$c1v@transfer.stratus.com>

I'm writing a perl script which is going to update the passwd file on 
all machines. I've got everything set, except I want to do a diff on the old
passwd file vs the new one to make sure I only get a one line difference.

I'd like to use the filehandle somehow to pass the filename to diff, but am
having problems doing that. I've declared diff with the use Shell directive, but
no matter how I pass the filehandle, it doesn't work.

I'd rather not have to hardwire the filename to a variable as it could be either
one of two names, and given the filehandle is already set to the correct
names(s), it makes sense to use it. Does anyone know what I need to do to get
this to work?

				Thanks,

				Phil
				ptanner@sw.stratus.com


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

Date: 21 Apr 1997 10:58:24 +1000
From: Chris.Bitmead@alcatel.com.au (Chris Bitmead uid(x22068))
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <s6yk9lxmbtb.fsf@aalh02.alcatel.com.au>


ouster@tcl.eng.sun.com (John Ousterhout) writes:

> One of the most common criticisms of my white paper has been that the
> distinction between scripting and system programming is artificial, and
> that it is possible for a single language to be good at both tasks.
> Lisp-like languages such as Scheme were suggested as living proof.  I
> can't prove that it's impossible for a single language to be good at
> both scripting and system programming, but I don't know of a good example
> and I doubt that it will ever happen.  The reason for this is the
> difference in typing, as I explained in the white paper. A given language
> embodies a particular style of typing, which can range from very strongly
> typed to totally untyped.  Once that decision has been made, the language's
> position on the spectrum between system programming and scripting is set.

You don't tell us though what typing has got to do with "systems vs
scripting". You don't say why a dynamically typed language can't be a
good systems language (lisp), or a statically typed language can't be
good at scripting (ML perhaps?)

> I think it's possible to have a language that's in the middle, but it's
> not likely to be terrific at either task.
> 
> Let's take Lisp as an example.  I think that Lisp falls somewhere
> between scripting and system programming.  Many of you have suggested that
> it is an ideal language for both system programming and scripting, but I
> think that it isn't really very good for either.  In fact I suspect that
> this may be why Lisp hasn't been used much for practical programming.
> Lisp isn't a good system programming language because it's too hard to
> write efficient programs 

I don't find it hard to write efficient programs in it. On what basis
do you make this comment?

> in it and it doesn't provide good low-level
> access to machine facilities.  

This is news to me. Give us an example.

> On the other hand, Lisp isn't good for
> scripting either.  In order to be a good scripting language, you need
> to be able to interoperate with lots of other things, which are often
> written in other languages (the best glues are those that stick to lots
> of different materials).  But Lisp has never been very good at this.
> For example, it's hard to include C code with Lisp because they have
> very different data types and memory models.  

This is a very strange comment indeed. Tcl and C have *very* different
data types and memory models. But you would have us to believe they
complement each other perfectly. Now you say that Lisp isn't good at
this because it has different types and memory model to C?? Actually
Lisp is much closer to C than Tcl is to C. So what?

> Lisp systems are typically
> closed: you have to live entirely in the Lisp world.  

This is news to me. All lisp systems that I've used allow you to link
in C libraries.

> Good scripting
> languages are open and friendly: they talk to and work with everything.
> 
> Just to short-circuit the discussion that will ensue...
> 
> I'm sure that many of you will argue against these claims ("my new
> version of Scheme is just as fast as C", "Lisp just needs a new garbage
> collector that embodies the latest techniques", "I know someone who
> combined C with Scheme and had no problems at all", etc.).  However,
> I've seen a fair amount of evidence on this and the problems far
> outnumber the success stories.  Many of the best minds in Computer
> Science have worked on Lisp over the last 30 years, and they haven't
> been able to fix the language so that it could be widely used either
> for system programming or scripting tasks.  This says to me that there
> is something fundamentally wrong with the language, at least for these
> tasks.

Is this the extent of your research into this subject? A few anecdotes
and a few usage statistics?

When I think of a good systems programming language I think of a
language that would be good for writing the UNIX systems utilities
in. Having written a few of these myself (like "ls") in C, I can say
with certainty that something like lisp or scheme would be much nicer
than C, and probably just as efficient. It would probably avoid some
of the built in limitations that tend to crop up in UNIX utilities
(like line length and error handling), because it's just too much
effort to do it "right" in C.
 
> By the way, I think that Lisp is a fascinating language with neat
> mathematical properties.  It's great for a variety of meta-programming
> tasks where you're experimenting with new programming paradigms, such as AI
> and language theory.  It just isn't good for system programming or scripting.
> This reinforces my claim that you should use different tools for different
> tasks.  This is also why I didn't mention Lisp in the paper.  The things I
> discussed in the white paper aren't the things that Lisp was designed for
> or that it does best, so it isn't really fair to compare Lisp along those
> dimensions.

Isn't fair for who :-)

























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

Date: 21 Apr 1997 02:30:01 -0700
From: mconst@soda.CSUA.Berkeley.EDU (Michael Constant)
Subject: Re: order of 'keys' and 'values'
Message-Id: <5jfc2p$oi0@soda.CSUA.Berkeley.EDU>

Paul W. Box <sanduku@nervm.nerdc.ufl.edu> wrote:
>1- how do keys() and values() determine the order in which they output
>elements?

The elements are output in whatever order they happen to be stored.
For efficiency, the internal order is determined by a hashing function:
the hashing function looks at a key and chooses where to store that
key/value pair.  (That way, when you ask perl to look up a given key,
it applies the same hashing function and immediately knows where the
value is stored.)  The location where the key "abc" is stored might
be very far from the location where "abd" is stored.

For all intents and purposes, the internal ordering really is useless.
If you want to access the elements of a hash in some order, you must
either sort them afterwards or keep them in order (see below).

>2- is there any way to have have the items of an array returned in the
>order in which they were entered?

Use the Tie::IxHash module from CPAN (see the perlmod(1) manpage for
more information).  With Tie::IxHash, your hash will behave just like
normal, except that the elements will always come out in the same order
you put them in.
-- 
        Michael Constant (mconst@soda.csua.berkeley.edu)


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

Date: 21 Apr 1997 00:20:39 GMT
From: ulric@edu.stockholm.se (Ulric Eriksson)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5jebsn$b2$1@news.edu.stockholm.se>

In article <wbybagw59h.fsf@peanut.jpl.nasa.gov>,
Will Duquette <will@peanut.jpl.nasa.gov> wrote:
>
>I confess, though I've toyed with Lisp and Scheme in the past, I'm
>primarily a C programmer.  Most of the people I work with are C
>or C++ programmers.  The Tcl version gives us warm fuzzies, and
>the Scheme version doesn't.

I'll bite. I do not at all think that C and Tcl resemble each other,
other than superficial things like the squigglies, which don't even
mean the same thing in the two languages.

OTOH, C and Scheme are similar in several ways: call-by-value,
pointer-chasing, free-format.


Ulric Eriksson
-- 
I proactively leverage my synergies.


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

Date: Mon, 21 Apr 1997 07:28:03 -0400
From: "Robert J. Trembley" <rtremble@ctissrv1.plt.ford.com>
Subject: Perl & ADO - anyone got a GOOD example?
Message-Id: <335B4F42.130E@ctissrv1.plt.ford.com>

I'm trying to get a Perl app working with ADO... No Luck yet... I can't
get the database connect to work at all...

Does anyone have a short working example?


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

Date: Sun, 20 Apr 1997 22:49:26 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: PERL Editor
Message-Id: <64oej5.dr3.ln@localhost>

Chris King (Chris.King@swindon-fc.demon.co.uk.mars) wrote:
: In article <s39bj5.be9.ln@localhost>, Tad McClellan <tadmc@flash.net>
: writes

: >Perl != CGI

: Surely you mean 'perl' ne 'CGI' ? :-)


But in any case, certainly not:

'perl' nee 'CGI'  ...


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 21 Apr 1997 11:37:03 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: Plans for DB_File for Berkeley DB 2.0?
Message-Id: <5jfjgv$qpa@pheidippides.axion.bt.co.uk>

Don Thomson (thomson@zinger.adp.wisc.edu) wrote:
: Version 2.0.2 of the Berkeley DB library is available, but the current
: DB_File in Perl5.003, which compiles fine with 1.85/1.86, doesn't
: compile with the new version.  Does anyone know what plans there are for
: a version of DB_File that does compile with the new library?

Here are my plans for DB_File:

    1. I'm currently upgrading DB_File to build and run with either
       version 1 or version 2 of Berkeley DB. When version 2 is used
       with DB_File, only the version 1 functionality will be
       available, so you won't get locking/transactions etc. 
       This upgrade is intended to allow existing DB_File scripts to be
       moved to Berkeley DB version 2 without any changes (apart from
       converting any existing databases version 1 databases).

    2. In parallel, I'm building a new interface which will support most
       of the new features of version 2. The interface to DB version 2
       is different enough to warrant a new module, plus there were
       some things in the existing DB_File interface that I wanted to
       change.

I expect to release the upgraded DB_File once DB version 2 settles down
and can pass 100% of the DB_File test harness (it currently passes
about 2/3). I'm not sure yet when the DB version 2 module will be
suitable for release.

If anyone has any comments/suggestions for the interface to Berkeley DB
version 2, I'll gladly accept them. 

Paul


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

Date: 21 Apr 1997 10:47:10 GMT
From: zpalastair@unl.ac.uk (ALASTAIR AITKEN CLMS)
Subject: Re: read string from file
Message-Id: <5jfgjf$fp8@epsilon.qmw.ac.uk>

In article <3357A486.C46@SD.BE>, Hans Suijkerbuijk <Hans.Suijkerbuijk@SD.BE> writes:
>----
>$search = "456";
>
>@input = <A>;
>$file = join('',@input);
>$file = s|[\w\W]*$search(.*?)\n[\w\W]*|$1|oe;
>---

#! /usr/local/bin/perl

use Benchmark;

timethese(100000, {
             'Name1' => '
open (IN1,"./test1.dat");
@input = <IN1>;
$search = "456";
$file = join("",@input);
$file =~ s|[\w\W]*$search(.*)?\n[\w\W]*|$1|oe;
close(IN1);
',
             'Name2' => '
$search = "456";
open (IN2,"./test2.dat");
@lines = grep (/$search/,<IN2>);
close(IN2);',
         });  

Benchmark: timing 100000 iterations of Name1, Name2...
     Name1: 30 secs ( 8.52 usr 15.69 sys = 24.21 cpu)
     Name2: 34 secs ( 6.69 usr 16.42 sys = 23.11 cpu)   

The overhead isn't much in using grep and the code is simpler.   The second
routine uses a much simpler pattern and stores all hits in an array in case
there are many rather than one.

Alastair.


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

Date: 21 Apr 1997 12:03:26 GMT
From: gary@wheel.tiac.net (Gary D. Duzan)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5jfl2e$3qn@news-central.tiac.net>

In article <8ghgh2injq.fsf@galapagos.cse.psu.edu>,
Scott Schwartz <schwartz@galapagos.cse.psu.edu.NO-SPAM> wrote:
=>
=>rajt@gco.apana.org.au writes:
=>| Plan 9 (of beloved memory ) did pretty much the same thing.
=>
=>And Inferno (c.f. comp.os.inferno, http://inferno.lucent.com/) does it
=>even more.
=>
=>Works great.

   To clarify, I have no problem whatsoever having things live in
a common namespace; that is obviously a good thing. What I have
some objection to is calling everything in that namespace a file.
The traditional notion of a file, an organized collection of data,
seems unnatural for things like terminals, system control interfaces,
etc. If you can make these thing look like files from one angle,
that's fine, and probably useful, but it still isn't a file. Calling
something what is isn't is not helpful when looking at it in the
abstract.

                                      Gary D. Duzan
                         Humble Practitioner of the Computing Arts





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

Date: 21 Apr 1997 09:46:37 +1000
From: Chris.Bitmead@alcatel.com.au (Chris Bitmead uid(x22068))
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <s6yohb9mf4y.fsf@aalh02.alcatel.com.au>

papresco@csclub.uwaterloo.ca (Paul Prescod) writes:

> In article <s6ypvvukubq.fsf@aalh02.alcatel.com.au>,
> Chris Bitmead uid(x22068) <Chris.Bitmead@alcatel.com.au> wrote:
> >While Lisp does not store numbers as strings, I never know or care
> >that this is the case. In fact I could write a Lisp implementation
> >that does store numbers as strings, and a programmer using it would be
> >none the wiser (apart from awful performance of course). Why do you
> >want to fit everything in a string?? It buys you NOTHING.
> 
> It buys you not having to write string->number. I don't think that this is a
> big win, but I could see how it would be useful to people who are not used
> to thinking about data types. Any programmer should run screaming from it,
> but I can see its value for end users. That explains why apps embed TCL, but
> not why programmers write whole programs in it.

If you're using string->number you're already doing fairly
sophisticated programming. The naive user can input and output numbers
without conversion.

scheme
> (* (read) 2)
10
=> 20




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

Date: 20 Apr 1997 13:46:31 -0400
From: danwang@nordica.CS.Princeton.EDU (Daniel Wang)
Subject: Re: Scripting vs. Systems
Message-Id: <r8t4td14mfc.fsf@nordica.CS.Princeton.EDU>

>>>>> "Marc" == Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de> writes:

    Marc> Daniel Wang (danwang@dynamic.CS.Princeton.EDU) wrote about Lisp:

    >> This is why Lisp doesn't have a type system,
	{stuff deleted}
    Marc> What it doesn't have is _enforced_ statically decidable typing.

This is my definition of a type system. I should be shot for forgetting some
people have very different ideas of what a type system is. **Statically
decidable** typing is what make "type systems" a win as it catches errors at
compile time rather than at runtime.



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

Date: Sun, 20 Apr 1997 17:33:17 PST
From: bouncenews@contessa.phone.net (Mike Meyer)
Subject: Universal scripting interfaces (Was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <19970420.40022388.FA37@contessa.phone.net>

In <MPG.dc2ce7a71e5d24d98977d@news.demon.co.uk>, cyber_surfer@gubbish.wildcard.demon.co.uk (Cyber Surfer) wrote:
> Alas. No wonder MS get ahead - they steamroller along, ignoring the 
> religious issues, and just _do it_. No wonder so many people feel a 
> need to slag them off. I'm one of them, BTW, so I'm criticising 
> myself! Was this what Richard P. Gabriel's "Lisp: Good News Bad News 
> How to Win Big" was about? Well, he didn't mention MS, but I guess 
> they're way of doing things is closer to "MIT" than "NJ".
> <URL:http://www.ai.mit.edu/articles/good-news/good-news.html>

See <URL: http://www.phone.net/home/mwm/workstations/good-enough.html
> for the draft of my take on this. I think that MS is further from
MIT than NJ is.

> > They aren't. Like I said, I (and a few million others) have had the
> > benefit of this functionality for most of the last decade.
> Has Guile been around for that long?

We aren't using Guile.

> > It appears that Unix may get such a solution in the form of
> > applications that support JVM as a scripting mechanism. This allows
> > any language that can be used to produce JVM bytecodes to be used for
> > scripting. There may be technical problems with this solution, but
> > it's a start.
> <sigh> Yet Another Language Specific Solution. Please note that 
> Activex isn't dependant on a single language. You don't have to use 
> JavaScript to appreciate ActiveX. It'll work with _any_ language 
> that's available as an ActiveX script engine.

I don't think this is a language-specific solution. After all, you can
use _any_ language that can be compiled to Java bytecodes. Java was
the first one. Last time I looked, people were talking about or
working on Java bytecode compilers for Python, Scheme and Perl. There
are problably others as well.

> I'm sure that something similar _could_ be done for Unix, but I've not 
> yet heard of it. Guile is close, but no cigar. Of course, if nobody 
> complains about using Scheme as the "VM", then there's no problem. 

If all you give them is JVM binaries, why should they CARE what the
source language was?  I have as yet to run into a user who really
cares whether a program was written in C, Scheme or Perl. I've seen a
few who complain that the programs are to big and blame it on the
implementation language, but they are a minority (and usually wrong
anyway).

> Unfortunately, that's been an effective block to progress for many 
> years. (Who remembers ACE?) If technical superiority really does 
> count, then please forget the political crap and just _do it_. You can 
> argue all you like about which language is "best" _after_ you've saved 
> the world...

If you believe the Gabriel paper you referenced, technical suepriority
doesn't count. Personally, I believe the paper, and further believe
that marketing counts for far more than technical superiority once
you've reached the "good enough" level described in my paper.
Believing that technical superiority counts left me with lots of
orphans.

	<mike

--
Do NOT reply to the address in the From: header. Reply to mwm instead
of bouncenews at the same machine. You have been warned.  Sending
unsoliticed email I consider commercial gives me permission to
subscribe you to a mail list of my choice.


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

Date: Mon, 21 Apr 1997 12:12:20 +0100
From: Jong <jong@mrc-lmb.cam.ac.uk>
Subject: What does  ^=  assignment op. do??
Message-Id: <335B4B94.41C6@mrc-lmb.cam.ac.uk>

Thanks a lot.

I could not get it in Perl book.

Cheers,

Jong




-- 
 I support Perl, Linux ...

With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?

	  ) Linux Newsletter

http://www.smli.com/people/john.ousterhout/scripting.html


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

Date: Mon, 21 Apr 1997 12:13:52 +0100
From: Jong <jong@mrc-lmb.cam.ac.uk>
Subject: What does ^= operator do??
Message-Id: <335B4BEF.167E@mrc-lmb.cam.ac.uk>

Thanks a lot,

Jong


-- 
 I support Perl, Linux ...

With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?

	  ) Linux Newsletter

http://www.smli.com/people/john.ousterhout/scripting.html


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

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 334
*************************************

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