HDTenEightyP/NetNews huggingface dataset:
From: jgd@acl.lanl.gov (Jerry G. DeLapp)
Subject: Re: Executing required files
Reply-To: Jerry G. DeLapp <jgd@acl.lanl.gov>
Organization: Advanced Computing Lab, LANL, NM
	<mcook.721447621@fendahl.dev.cdx.mot.com>
	<1992Nov11.145949.6745@news.eng.convex.com>
Distribution: comp.lang.perl
Date: Fri, 13 Nov 1992 20:00:42 GMT


> From the keyboard of mcook@fendahl.dev.cdx.mot.com (Michael Cook):
> :jgd@acl.lanl.gov (Jerry G. DeLapp) writes:
> :
> :>I still like the idea of __REQUIRED__ to armor plate me from idiots setting $0
> :>though. Any chance of this appearing in 5.0?
> :
> :What's wrong with setting $0?  At the risk of declaring myself an idiot, I do
> :this pretty-much as a matter of course: $0 =~ s%^.*/%%;

Regarding Re: Executing required files; Tom Christiansen <tchrist@convex.COM>
adds:

Tom> You lose your visible arguments to ps.  Better this way:

Tom>     $0 =~ s%^.*/%%;  # clobbered visible @ARGV
Tom>     $0 .= " @ARGV";  # restore

Re "idiot..." I was just echoing what I thought was an amusing comment from
the proposed code to solve the problem. I screw around with $0 at times too.
(Yeah, I AM an idiot... paranoid too! ;-).

The point is, that if someone alters $0 ahead of the point where you compare
it with __FILE__ you lose the validity of "if ($0 eq __FILE_)" as a test of
whether or not you are in a require. The code will ALWAYS think it's being
required. That's why I'd like to see __REQUIRED__ as a reliable piece of
information.

--

Jerry G. DeLapp -- ACL System Scientist -- (505) 665-4531 <jgd@lanl.gov>
Computing beyond the Bleeding Edge -- The Advanced Computing Laboratory
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.lang.perl
Subject: Re: Help with quotes
Date: 6 Nov 92 19:05:30 GMT
Distribution: comp
Organization: NetLabs, Inc.

In article <FILO.92Nov4211406@pegasus.Stanford.EDU> filo@pegasus.stanford.edu writes:
: I'm having a bit of a problem with quoting.
: 
: This works as expected.  It replaces the first character with a double-
: quote.
: 
: $ perl -pe 's/./sprintf ("\\"")/e; print "<$@>" if $@'
: help
: "elp
: $
: 
: Below is the same thing except $& has been added to the sprintf.  In
: this case the evaluation of the replacement string fails.  I have not
: been able to find a way to properly escape the double-quote to be
: printed.
: 
: $ perl -pe 's/./sprintf ("$&\\"")/e; print "<$@>" if $@'
: help
: <EOF in string at (eval) line 1, <> line 1.
: >elp
: $
: 
: I know I could just changes quote characters, but I need a way to
: include the quote character inside the quoted string.

Admittedly it's probably a bug, but changing the inner quote characters
is not your only option.  You can also change the outer quote characters,
like this:

    perl -pe 's/./sprintf(qq!$&"!)/e; print "<$@>" if $@'

The whole idea of q and qq is to get away from the necessity of
counting backslashes or parens.  (One of the benefits of having More
Than One Way To Do It is that if one of the ways doesn't work out, you
can do it a different way, no?)

By the way, why are you using sprintf?  The only action of sprintf in
this example would be to swallow the replacement if $& happened to
evaluate to %.  Doesn't seem too useful...

Larry
From: petonic@hal.com (Michael A. Petonic)
Subject: Re: PERL-interface to QUIPU?
Reply-To: petonic@hal.com (Michael A. Petonic)
Organization: Henry's Laughing Gas Co., Inc.
Date: 05 Nov 92 05:57:50 GMT

In article <1992Nov2.114617.14603@aau.dk> adminpb@aau.dk (Nis Peder Bonde) writes:
>Has anybody made an interface for PERL to access a QUIPU-database
>with DSA-management-operations?
>
>I could imagine a perl-implementation linked with libdsap and
>some glue-routines a' la oraperl...
>
>				Bonde

No, but if you get one working, I know that Stephen Hardcastle-Kille
would like to hear from you...  Me, too, for that matter.

-pet-
--
Michael A. Petonic	       petonic@hal.com		       +1-512-794-2855
        HaL Computer Systems International, Ltd. -- A Bermuda Corporation
                     Director of Dangerous Activities  [ACK to GeoffK@ism780c]
				 Austin, Texas
                          "No balls, no blue chip."
Newsgroups: comp.lang.perl
From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
Subject: Re: Executing required files
Organization: Motorola Codex, Canton, Massachusetts
Distribution: comp.lang.perl
Date: Wed, 11 Nov 1992 02:07:01 GMT

jgd@acl.lanl.gov (Jerry G. DeLapp) writes:

>I still like the idea of __REQUIRED__ to armor plate me from idiots setting $0
>though. Any chance of this appearing in 5.0?

What's wrong with setting $0?  At the risk of declaring myself an idiot, I do
this pretty-much as a matter of course: $0 =~ s%^.*/%%;

Michael.
From: marcap@cs.concordia.ca (PAWLOWSKY marc)
Newsgroups: comp.lang.perl
Subject: MS-DOS Protected Mode Interface (DPMI) version.
Summary: Does anybody want to archive the changes?
Date: 13 Nov 92 19:53:56 GMT
Organization: Computer Science, Concordia University, Montreal, Quebec



I have ported PERL 4.0 patch level 35 to MS-DOS protected mode.  
There are some known bugs (same as in the DOS port).  Does anybody
want to handle the modified files (the changes are very minor.)

Marc Pawlowsky

Newsgroups: comp.lang.perl
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: [bind] Bind on a Cray
Originator: tchrist@pixel.convex.com
Date: Wed, 11 Nov 1992 00:19:56 GMT
Distribution: usa
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of jns@ace.nas.nasa.gov (John N. Stewart):
:
:Configuration: 6.1.6 nas.29 CRAY Y-MP
:Error:         bind: Invalid argument
:
:Code Frag:     bind(DATA, $us) || die "bind: $!\n";
:
:
:The program is the Perl version of archie, yet the Cray bind doesn't
:act differently on a call basis. Has anyone run into this on some
:architecture of some type, and could have a clue where the problem
:lies? 

The problem doesn't lie, the program does.  It lies about the 
types of the socket struct args.  Compare the evilly hardcoded
socket structs with what c2ph tells you to use.

Just a guess, but I've heard of this on Crays before.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist

"I think there's a world market for about 5 computers."
	- Thomas J. Watson, Chairman of the Board, IBM (around 1948)
Newsgroups: comp.lang.perl
From: utashiro@sran230.sra.co.jp (Kazumasa Utashiro)
Subject: Re: Partial RegExp's
Organization: Software Research Associates, Inc., Japan
Date: Thu, 12 Nov 1992 04:43:51 GMT

In article <BxGFIy.LuA@news.cso.uiuc.edu>
	chappell@math.uiuc.edu (Glenn Chappell) writes:
>> Of course, the way you deal with huge files is to read them in chunks.
>> The problem with that is that you miss a pattern match that starts on
>> one chunk and ends on another.

My mg (multi-line grep) script is doing pattern match like
this:

********************
               *************************
                                   *************************

Of course, there possibly be missing matches but this method
works fine for my purpose.  Also it is true that making this
kind of program is very tough.  I had to spend a lot of time
to debug it.

--utashiro
Newsgroups: comp.lang.perl
From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
Subject: scripts should indicate the Perl version (a proposal)
Organization: Motorola Codex, Canton, Massachusetts
Date: Mon, 9 Nov 1992 16:32:03 GMT

How about this idea: There should be a way to specify in a Perl script what
version of Perl the script was written for.  Then, as new keywords and other
non-backwardly-compatible functionality are added, old scripts could still
likely work correctly.  For example, these two scripts might behave
differently:

 #! /usr/local/bin/perl
 version 2.0;
 print "1" | "2";

 #! /usr/local/bin/perl
 version 4.0;
 print "1" | "2";

because the | operator's meaning changed between Perl versions 2.0 and 4.0 (or
whenever).  With the first script, perl would see the "version 2.0" statement,
and disable that new meaning associated with the | operator.

Make sense?

Michael.
From: watson@carssdf.UUCP (- Self Empl. Sys.Integrator)
Newsgroups: comp.lang.perl
Subject: Re: perl lockf
Date: 8 Nov 92 14:16:08 GMT
Reply-To: watson@carssdf.UUCP (John Watson -- Self Empl. Sys.Integrator)
Organization: John Watson (Self Employed System Integrator)

In reply to errors locking file etc...

I had a problem locking printers till I discovered that I had to have
read priv. to lock the device, so now I open with "+>", sample follows:
I include this with do 'openpf.ph' statement. (predates require).

$pfile_nm = $ENV{'RPTPRN'};
if ($pfile_nm =~ /^[.\/]/) {
	open (PF,"+>$pfile_nm") || die "\n Printer is in use. \n";
	$lockit = pack('s2l2s2',1,0,0,0,0,0);
	fcntl(PF,6,$lockit) || die "\n Printer is in use. \n";
} else {
	if ($pfile_nm =~ /^[^|]/) { $pfile_nm = '|lp -s -d'.$pfile_nm; }
	open(PF,"$pfile_nm") || die "\n Unable to open spooled printer ($pfile_nm) \n";
}
select(PF);

 --------- end --------
Newsgroups: comp.lang.perl
From: forrie@morwyn.uucp (Forrest Aldrich)
Subject: Script wanted
Organization: Vision Graphics
			  Dover, NH
			  USA
Date: Sat, 7 Nov 1992 12:33:17 GMT

Does anyone have a perl script (or curseperl) that will handle the 
addition and deletion of UUCP accounts, using HDB UUCP (Permissions, etc.)?
Something like that would be incredibly handy, but I haven't seen one
yet.

Thanks ...

-- 
	   -----------	      Forrest Aldrich	      -----------
	   -------     morwyn!forrie@unhtel.unh.edu	  -------
	   ----						     ----
	   --	     VISION GRAPHICS --	Dover, NH - USA	       --
	   ------------------------------------------------------
Newsgroups: comp.lang.perl
From: mnrausch@cip.informatik.uni-erlangen.de (Martin Rausche)
Subject: sorting problem
Organization: Student Pool, CSD, University of Erlangen, Germany
Date: Thu, 12 Nov 1992 17:28:50 GMT
Keywords: sort

I need a fast sorting routine for the following problem:
I have a database and the entries look like this:
keyword;author;title;owner
My solution:

sub byname
{
        @ah=split(/;/,$a);
        @be=split(/;/,$b);
        shift(@ah);
        shift(@be);
        $ah=join(";",@ah);
        $be=join(";",@be);
        $ah cmp $be;
}

@data=sort byname @data;

This is a very slow procedure, but how can I speed it up?

Thanks in advance. Martin.
(mnrausch@cip.informatik.uni-erlangen.de)
Newsgroups: comp.lang.clos
From: almond@statsci.com (Russell G. Almond)
Subject: Re: clos initforms
Organization: Statistical Sciences, Inc., Seattle, WA USA
Date: Tue, 10 Nov 1992 20:15:55 GMT


Jeffery Asks:

> (defun make-test-class ((me test-class) &key (:slot-1 1) (:slot-2 nil))
> 	(unless slot-2
> 		(setf slot-2 slot1)) ; if no default value for slot-2 use 
>                                    ; slot-1's value
> 	(make-instance 'test-class :slot-1 slot-1 :slot-2 slot2))

> The problem I see with this approach is that it does not let you specify a nil 
> value for
> slot-2.  What I'm looking for is a general solution that doesn't lock out some 
> previously
> defined "bad" value (nil in the above example).

>     Jeffrey


I think you want the third (suppliedp) argument for &key (and &optional)
parameters in a lambda list.  Thus:

(defun make-test-class ((me test-class) &key (:slot-1 1)
                                             (:slot-2 nil slot-2?))
	(unless slot-2?
		(setf slot-2 slot1)) ; if no default value for slot-2 use 
				     ; slot-1's value
	(make-instance 'test-class :slot-1 slot-1 :slot-2 slot2))

This should do what you want.  (There should be an equivalent way to to
it with a shared-initalize method, I'm not as familiar with that
approach.)


			Russell Almond			   
Statistical Sciences, Inc.		
1700 Westlake Ave., N Suite 500		
Seattle, WA  98109			
(206) 283-8802				
almond@statsci.com			

Newsgroups: comp.lang.clos
From: peterson@sra.COM (Eric Peterson x7644)
Subject: class prototypes
Organization: The Ohio State University Department of Computer and Information Science
Date: Sat, 7 Nov 1992 15:35:40 GMT

>>>>> On Sat, 7 Nov 1992 00:35:37 GMT, charest@Aig.Jpl.Nasa.Gov (Len Charest) said:

   Len> Interesting question. In my program I'm actually using the
   Len> class-prototype to access a *shared* slot (allocation :class).
   Len> That is, I'm more interested in a 'CLASS-VOLUNTEER' than a
   Len> prototype. This approach works, but should it?  My
   Len> understanding is that 'the slots' of class-prototype remain
   Len> uninitialized;


A recent message of mine may have mislead you into thinking that
class prototypes must be uninitialized.  A reply to that
message by Jon "Lucid" White suggests that this lack of initialization
is a matter of expedience rather than requirement.  I read his message
as saying that class-prototype unboundness for instances of
non-metaclasses is Lucid's way of saying the following:  There is no
way to predict an application instance's slots contents; so we would
not know what to cache in a prototype's slot that would be useful to
anyone.  We find it efficient in the case of metaobjects, however, to
do caching since metaclass instances tend to share certain components
of their slot contents and these cached components save us time when
initializing these instances.  Note that

(inspect
 (clos:class-prototype
  (class-of (find-class 'some-application-instance))))

shows some of this cached information.

   Is this a fair extrapolation on your reply, Jon?



                                   Eric Peterson (speaking for myself)
                                   Systems Research and Applications
                                   2000 15th Street North
                                   Arlington, VA 22201
                                   USA
                                   peterson@sra.com
                                   (703) 558-7644
                                   Fax:  (703) 558-4723
From: davis@passy.ilog.fr (Harley Davis)
Newsgroups: comp.lang.clos
Subject: Re: Avoiding CLASS-PROTOTYPE
Date: 5 Nov 92 10:16:55 GMT
	<1992Nov3.002630.23187@jpl-devvax.jpl.nasa.gov>
Organization: ILOG S.A., Gentilly, France
In-reply-to: charest@Aig.Jpl.Nasa.Gov's message of 3 Nov 92 00:26:30 GMT


I think a cleaner solution would be to add a new keyword to the
ALLOCATE-INSTANCE method which said whether the instance was a
prototype or not.

-- Harley Davis
--

------------------------------------------------------------------------------
nom: Harley Davis			ILOG S.A.
net: davis@ilog.fr			2 Avenue Gallie'ni, BP 85
tel: (33 1) 46 63 66 66			94253 Gentilly Cedex, France
From: george@hsvaic.boeing.COM (George Williams)
Newsgroups: comp.lang.clos
Subject: Re: clos initforms
Date: 9 Nov 92 01:54:38 GMT
Article-I.D.: hsvaic.9211091354.AA04928
Organization: The Ohio State University Department of Computer and Information Science

On Nov 9,  5:35am, Jeffrey B Kane wrote:
> The problem is that I need for slot-2 to default to the same value as
> slot-1 if the user does not specify it in the constructor.

I don't think you can do this with initforms.  You could use an :after
method on initialize-instance or shared-initialize which would check for
the presence of the initarg.

George Williams            BCS Huntsville Artificial Intelligence Center
Boeing Computer Services   Internet: george@hsvaic.boeing.com
POBox 240002, M/S JY-58    UUCP: ...!uw-beaver!bcsaic!hsvaic!george
Huntsville AL 35824-6402   Phone: 205+464-4968 FAX: 205+464-4930
Newsgroups: comp.lang.clos
From: peterson@sra.COM (Eric Peterson x7644)
Subject: Avoiding CLASS-PROTOTYPE (Attn: MOP gods)]
Organization: The Ohio State University Department of Computer and Information Science
Date: Thu, 5 Nov 1992 15:05:26 GMT

Hi Len;
   Some parens or better wording would have made my intent clearer.
Sorry about the mixup.  I have added in parens -  *(* *)* - to clear
things up.

   Eric> Since class instance prototypes have nothing but unbound
   Eric> slots, perhaps the MOP should specify that class instance
   Eric> prototypes be created with allocate-instance *(*instead of
   Eric> using make-instance (as Lucid has done)*)*.


                                   Eric Peterson (speaking for myself)
                                   Systems Research and Applications
                                   2000 15th Street North
                                   Arlington, VA 22201
                                   USA
                                   peterson@sra.com
                                   (703) 558-7644
                                   Fax:  (703) 558-4723

Newsgroups: comp.lang.clos
From: welch@sacral.cis.ohio-state.edu (Arun Welch)
Subject: Re: calling C routines from CLOS
Originator: welch@sacral.cis.ohio-state.edu
Organization: OSU-LAIR
Date: Fri, 6 Nov 1992 18:52:38 GMT

In article <zen.721071130@texas> zen@syl.dl.nec.com (zen kishimoto) writes:

   We are writing a set of CLSO interface to call a set of C rutines.
   These C routines include complex parameters, such as a pointer to struct
   or struct itself.  Is this FAQ?  If so, where is it?

I'm not sure what the question you're asking is, but it seems to be
"Can we call C from CLOS?". Yes you can in most (all?) Unix Lisp
implementations, but the actual way is different between the
implementations. DARPA had an RFP for a standard foreign function call
interface out in January, but I'm not sure if it got funded, and if so
who got it. Such a beast would indeed be a handy thing.

...arun
----------------------------------------------------------------------------
Arun Welch
Lisp Systems Programmer, Lab for AI Research, Ohio State University
welch@cis.ohio-state.edu


Newsgroups: comp.lang.clos
From: charest@Aig.Jpl.Nasa.Gov (Len Charest)
Subject: Why CLASS-PROTOTYPE at all? (was Re: class prototypes
Reply-To: charest@aig.jpl.nasa.gov
Organization: NASA/Jet Propulsion Laboratory
Date: Sat, 7 Nov 1992 00:45:40 GMT

In article <9211052256.AA05389@thelonius.mitre.org>, john@linus.mitre.org writes:

|> This discussion seems to assume that the class-prototype is NOT
|> identical to a user-created instance. 

Maybe some of the designers of PCL and/or CLOS could shed some light on the
origin and history of CLASS-PROTOTYPE. I'd like to know specifically why the
language should be responsible for creating and maintaining 'prototypes'. Why
can't application programs do this as needed? Indeed, I might like to say
something like
	(setf (class-prototype my-class) my-instance)
 
|> Of course, the prototype is often (usually?) needed BEFORE the user
|> instantiates a class. 

Needed by CLOS or needed by the programmer? I'd guess the former.
..................................................
                                  Len Charest, Jr.
                 JPL Artificial Intelligence Group
                          charest@aig.jpl.nasa.gov
From: jeh@windrider.llnl.gov (Jose E. Hernandez)
Newsgroups: comp.lang.clos
Subject: Re: clos initforms
Keywords: INITFORM DEFAULT-INITARG INITIALIZE-INSTANCE
Date: 9 Nov 92 16:43:41 GMT
Reply-To: jeh@llnl.gov
Organization: Lawrence Livermore National Laboratory


|> I have a class with several slots As an example:
|> 
|> (defclass test-class ()
|> 	((slot-1	:initarg :slot-1
|> 		:initform 1
|> 		:accessor slot-1)
|> 	(slot-2	:initarg :slot-2
|> 		:initform ?????      ; <- The question
|> 		:accessor slot-2)))
|> 
|> The problem is that I need for slot-2 to default to the same value as
|> slot-1 if the user does not specify it in the constructor.
|> 
|> (setf my-class-1 (make-instance 'test-class :slot-1 12))
|> 
|> (setf my-class-2 (make-instance 'test-class :slot-1 12 :slot-2 18))
|> 
|> Jeffrey Kane, MD
|> Kane Biomedical Systems
|> Boston MA

(defparameter *default-test-class-slot-value* 1)

(defclass test-class ()
	((slot-1 :initarg :slot-1
	 	 :initform *default-test-class-slot-value*
	 	 :accessor slot-1)
	 (slot-2 :initarg :slot-2
		 :initform *default-test-class-slot-value*
		 :accessor slot-2)))

(defmethod shared-initialize ((inst test-class) slots &rest initargs
                              &key slot-1 slot-2)
   (if (and slot-1 (not slot-2))
      (apply #'call-next-method inst slots :slot-2 slot-1 initargs)
    (call-next-method)))

jeh
Newsgroups: comp.lang.clos
From: smh@franz.com (Steve Haflich)
Subject: Re: CHANGE-CLASS on specialized metaclass
Organization: The Ohio State University Department of Computer and Information Science
Date: Tue, 10 Nov 1992 13:01:55 GMT

   From: charest@Aig.Jpl.Nasa.Gov (Len Charest)

   STANDARD-CLASS has the interesting property that it is an instance of itself. 
   Suppose I want to make a specilized metaclass that also has this property:

   Should this work in a correct implementation of CLOS? Should it matter whether
   MY-CLASS has been finalized before the call to CHANGE-CLASS? My intuition is that
   the above code should perform as expected--even in the absence of a MOP since the
   functions involved (DEFCLASS, CHANGE-CLASS and SLOT-VALUE) are all part of the
   'regular' CLOS programmer interface. My experience shows otherwise:

   Allegro 4.1  Sparc2/SunOS 4.1.1  Throws into debugger during CHANGE-CLASS.
				    "No methods applicable for gf: CLOS:CLASS-DIRECT-
				    SLOTS with args (#<CLOS:FORWARD-REFERENCED-CLASS 
				    STANDARD-CLASS...> of classes (CLOS:FORWARD-
				    REFERENCED-CLASS)"
				    Same error occurs if attempt to finalize MY-CLASS
				    before CHANGE-CLASS.
   Comments?

I agree it should work, and that it should not matter whether the
class has yet been finalized.  So I tried to reproduce the failure,
but it worked just fine for me:

   Allegro CL 4.1 [SPARC; R1] (4/13/92 21:39)
   ...
   (1): (defclass my-class
	    (standard-class)
	    ((arbitrary-slot :initform (gensym))))
   #<STANDARD-CLASS MY-CLASS @ #x8977de>
   (2): (change-class (find-class 'my-class) (find-class 'my-class))
   #<MY-CLASS MY-CLASS @ #x8977de>
   (3): (find-class 'my-class)
   #<MY-CLASS MY-CLASS @ #x8977de>
   (4): (slot-value (find-class 'my-class) 'arbitrary-slot)
   #:G42

   Allegro CL 4.1 [SPARC; R1] (4/13/92 21:39)
   ...
   (1): (defclass my-class
	    (standard-class)
	    ((arbitrary-slot :initform (gensym))))
   #<STANDARD-CLASS MY-CLASS @ #x8977de>
   (2): (defclass your-class () () (:metaclass my-class))
   #<MY-CLASS YOUR-CLASS @ #x899dfe>	; finalizes inheritance
   (3): (change-class (find-class 'my-class) (find-class 'my-class))
   #<MY-CLASS MY-CLASS @ #x8977de>
   (4): (slot-value (find-class 'my-class) 'arbitrary-slot)
   #:G43

These two examples were in fresh images with no patches loaded.  I
can't be sure why the example didn't work for you, but the appearance
of STANDARD-CLASS as a FORWARD-REFERENCED-CLASS suggests a package
problem -- that you were working in some package in which the symbol
COMMON-LISP:STANDARD-CLASS is not present by inheritance.

I'll contact you privately from bugs@franz.com to pursue this without
bothering the entire common-loops list.
Newsgroups: comp.lang.clos