HDTenEightyP/NetNews huggingface dataset:
From: sullivan@teal.csn.org (Steve Sullivan)
Subject: ml questions
Organization: Colorado SuperNet, Inc.
Date: Sun, 15 Nov 1992 15:55:56 GMT


I'm enjoying learning sml, and had a few
questions.  Please let me know if you can shed
any light on any of these!  Many thanks ...


1. The sml I'm using, from princeton.edu, includes Harper's notes.
His notes document the "system" and "cd" commands.
Yet sml apparently doesn't recognize them.  How can I get them working?


2.  How can I get a function to remember state?

In particular, I want to write a random number
generator that remembers it's last seed,
so the caller doesn't have to provide it.  Many modern
generators require hundreds of bytes of state info, so passing
that in and out on each call is very inefficient.

Simple example - how to get sml to do something like:

fun rand 1 = let val seed = ref 1 in !seed end   (* initialize and return 1 *)
  | rand 2 = (seed := (xx*seed) mod yy; !seed;)  (* update seed, return it *)


3. Why not allow nonlinear patterns?  They wouldn't have to cover
the whole general matching problem - just allow, for example,
   fun (x,x) = ...
to bind the first x, and then fail if the second x doesn't match.



4. Why not lazy functions?  Seems lazy and strict evaluation
could be mixed, with functions being lazy by default, and 
strict if:
  - they used any imperative features
  - they used any function which is strict
I looked at lsml from sbcs.sunysb.edu, but at first glance
it seems very experimental and somewhat out of date.


If you have light to shed on any of these, please let me
know!  Many thanks -

Steve Sullivan
sullivan@csn.org


Newsgroups: comp.lang.functional
From: "Felix Schroeter" <UK1O@DKAUNI2.BITNET>
Subject: Gofer-Sources wanted - allright
Organization: University of Karlsruhe, Germany
Date: Thu, 19 Nov 1992 13:42:27 GMT

Hello.
A few days ago i wrote a question about where to find the Gofer
sources (UNIX Version).
I have received MANY replies and have ftp'ed the sources right now.
So: The replies are enough :-)

Thanks for the multiple help :-)

regards from Felix
Felix Schroeter - uk1o@ibm3090.rz.uni-karlsruhe.de
>>>>> Hierarchical systems are for files, not for humans <<<<<
Newsgroups: comp.lang.functional
From: farrell@coral.cs.jcu.edu.au (John Farrell)
Subject: Re: Including files from ml-lex and -yacc
Keywords: ml-lex ml-yacc sml
Organization: James Cook University
Date: 16 Nov 92 06:33:55 GMT

In <1992Nov10.142821.8095@daimi.aau.dk> urban@daimi.aau.dk (Urban Engberg) writes:
>In the language of a parser I am writing I want to use the parser
>directive %Include <filename> meaning that the file <filename> is to
>be included in the parsed file just as if its contents were actually
>put there.

  I thought the standard way to do this was to use the same compiler
directives as C does, then use the C preprocessor :-). It's a hack, I know,
but it provides a well-known set of functions at very low cost.

John
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.functional
Subject: Re: ml questions
Date: 16 Nov 92 05:59:29 GMT
Article-I.D.: alice.24205
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Murray Hill NJ

In article <BxrLL9.A11@csn.org> sullivan@teal.csn.org (Steve Sullivan) writes:

> 1. The sml I'm using, from princeton.edu, includes Harper's notes.
> His notes document the "system" and "cd" commands.
> Yet sml apparently doesn't recognize them.  How can I get them working?

They're there, but buried in structures.  Try System.system
and System.Directory.cd

> 2.  How can I get a function to remember state?

A simple example -- perhaps too simple:

	val seed = ref 1;
	fun rand() = (seed := (xx * !seed) mod yy; !seed);
-- 
				--Andrew Koenig
				  ark@europa.att.com
From: miller@diego.llnl.gov (Patrick Miller)
Newsgroups: comp.lang.functional
Subject: Re: Including files from ml-lex and -yacc
Keywords: ml-lex ml-yacc sml
Date: 17 Nov 92 16:57:06 GMT
Organization: Lawrence Livermore National Laboratory

In article <farrell.721895635@coral>, farrell@coral.cs.jcu.edu.au (John Farrell) writes:
|> >directive %Include <filename> meaning that the file <filename> is to
|> ...

|>   I thought the standard way to do this was to use the same compiler
|> directives as C does, then use the C preprocessor :-). It's a hack, I know,
|> but it provides a well-known set of functions at very low cost.

One has to be careful how this is done.  Remember that C preprocessors
have varying awareness of comment characters, etc...   The following
was causing the Sisal preprocessor (a CPP hack as described) to bomb.
The % is a comment character.

		for initial			% Can't do it too much

The problem was that Sisal uses Mark-to-endofline comments.  The CPP
was getting confused over the single quote without matching end quote!

-- 
Pat Miller                            I have many opinions, but they
patmiller@llnl.gov                      generally aren't humble ones
From: UK1O@DKAUNI2.BITNET (Felix Schroeter)
Newsgroups: comp.lang.functional
Subject: Gofer-Sources wanted
Date: 17 Nov 92 09:52:28 GMT
Article-I.D.: rz.1992Nov17.095228.2314
Organization: University of Karlsruhe, Germany

Hello!
I am looking for sources of the Haskell derivate Gofer.
They are free and available via ftp, but i dont know on which
server. The best would be, if you drop me a line to my EMail-
adress, if you know it. The best would be UNIX-sources, because
i want to port them with Float and 32-Bit-Int-support for Atari ST.

Thanks in advance.
Felix Schroeter - uk1o@ibm3090.rz.uni-karlsruhe.de
Newsgroups: comp.lang.functional
From: wolfe@sequent.com (David Wolfe)
Subject: Illinois Functional Programming
Organization: Sequent Computer Systems, Inc.
Distribution: us
Date: Wed, 18 Nov 92 22:06:00 GMT

Sorry if this is an FAQ (or just plain annoying), 
but does anyone know if the ifp system is available via ftp?

Ifp being the implementation of Bachus' fp done at UI (I am not sure
which campus).

-DaveW

-- 
|    ,__o  | In mondo caeco,   |    ,__o  |    wolfe@sequent.com   |  o__,    |
|  _-\_<,  | luscus regnat.    |  _-\_<,  | ..!uunet!sequent!wolfe |  ,>_/-_  |
| (*)/'(*) |                   | (*)/'(*) |    (503) 578-4395      | (*)`\(*) |

-- 
|    ,__o  | In mondo caeco,   |    ,__o  |    wolfe@sequent.com   |  o__,    |
|  _-\_<,  | luscus regnat.    |  _-\_<,  | ..!uunet!sequent!wolfe |  ,>_/-_  |
| (*)/'(*) |                   | (*)/'(*) |    (503) 578-4395      | (*)`\(*) |
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.functional
Subject: Re: Is efficient backtracking feasible in functional languages?
Followup-To: comp.lang.functional
Date: 15 Nov 92 19:53:22
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
	Perceptive)
	<1992Nov12.220621.14143@cs.tu-berlin.de>
Reply-To: tmb@idiap.ch
NNTP-Posting-Host: arolla.idiap.ch
In-reply-to: wg@opal.cs.tu-berlin.de's message of Thu, 12 Nov 1992 22:06:21 GMT

In article <1992Nov12.220621.14143@cs.tu-berlin.de> wg@opal.cs.tu-berlin.de (Wolfgang Grieskamp) writes:

   >   strangesucc n =	hd [x|x<-[0..];x>n];
   >   ...
   >   [Major collection... 21% used (3397260/15733684), 1920 msec]
   >   ...
   >   GC Stack Overflow !

   Whats funny with this example that the stream (lazy list) in the list
   comprehension can be seen as an imperative counter which is
   communicated to the consumer (hd): [example deleted]

Sure. Many such expressions can be converted into something imperative
(c.f. the CommonLisp Iterate macros). However, some interesting and
useful others cannot.

In general, I do think it would be nice if streams became a part of
eager functional programming languages and if optimizers tried to do a
better job at optimizing them. What about it for "SML the next
generation"?

					Thomas.
Newsgroups: comp.lang.pop,comp.mail
From: jcl@deshaw.com (Jonathan Laventhol)
Subject: (Post Office Protocol?)
Follup-To: comp.mail
Organization: D. E. Shaw & Co.
Date: Fri, 20 Nov 1992 17:56:15 GMT

[comp.mail: This is cross-posted from comp.lang.pop, where
people are wondering if it's about the Post Office Protocol.]

Hello --

POP the Post Office Protocol is a very fine thing, but please
don't discuss it here, which is about Pop11, the symbolic
programming language, and related issues.

Yes, there's a name clash because both had a thing called
POP2.  It doesn't matter.  The protocol is on POP3, the
language is at Pop11, the language system is called POPLOG.

If you want to know more about the protocol, please read
	1225  Rose, M.T.  Post Office Protocol: Version 3.  1991 May;
	16 p. (Format: TXT=37340 bytes)

To get this document, send a one-line mail message to
<mail-server@nisc.sri.com> with no subject:
	SEND rfc1225.txt

Follow-ups have been redirected to comp.mail, and this is
cross-posted.

Thank you.
J.
From: sfk@otter.hpl.hp.com (Steve Knight)
Date: Tue, 17 Nov 1992 17:52:42 GMT
Subject: Re: A little Pop history
Organization: Hewlett-Packard Laboratories, Bristol, UK.
From: bh@anarres.CS.Berkeley.EDU (Brian Harvey)
Newsgroups: comp.lang.pop
Subject: Re: FTP'able pop for msdos
Date: 17 Nov 1992 21:45:30 GMT
Organization: University of California, Berkeley
NNTP-Posting-Host: anarres.cs.berkeley.edu

kers@hplb.hpl.hp.com (Chris Dollin) writes:
>Saffron, or Karl, or Salt. Something like that.
                            ^^^^^^^^^^^^^^^^^^^^

Could you please explain the category that these are examples of?  (Don't say
"words"!)  :-)
Xref: sparky comp.lang.pop:69 alt.lang.basic:870
From: mst@vexpert.dbai.tuwien.ac.at (Markus Stumptner)
Newsgroups: comp.lang.pop,alt.lang.basic
Subject: Re: Ok, so pop *pop* may be a valid lang, but where's basic?
Date: 18 Nov 92 13:43:27 GMT
Followup-To: alt.lang.basic
Organization: DB and ES Subdivision, TU Vienna

From article <BxoIzG.H94@access.digex.com>, by bruceg@access.digex.com (Bruce Garrett):
>         Yah.  Right.  Funny how other languages are allowed to grow and
> evolve, C becomes C++, Fortran goes through it's changes...

...and you get huge languages (C++ is more complex than Ada which for
years was the laughing stock of programming languages), monsters which
retain above all syntactic compatibility while integrating lots of new
concepts into a framework that was not intended for holding them.  All
these extensions are not free from criticism.  As with Basic, the
community is large enough to support such an evolution instead of a
switch to newer, cleaner languages.  They work, and that is sufficient
for their existence (and flourishing).  That's all.  But "good"
languages by today's standards?

If extended Basics work for you, because you have years of experience
in Basic and don't want to waste it, fine.  (Not intended as a Basic
flame, but I would assume that those Basics have not evolved into huge
languages [or have they?] because so much of the work spent on them
was for bringing Basic to normal size.)  
-- 
Markus Stumptner                                mst@vexpert.dbai.tuwien.ac.at
University of Technology Vienna                 vexpert!mst@relay.eu.net
Paniglg. 16, A-1040 Vienna, Austria             ...mcsun!vexpert!mst
From: anderson@sapir.cog.jhu.edu (Stephen Anderson)
Newsgroups: comp.lang.pop
Subject: Re: PD Pop
Date: 18 Nov 92 20:28:45 GMT
Organization: Dept. of Cognitive Science, The Johns Hopkins University
In-reply-to: axs@cs.bham.ac.uk's message of 17 Nov 92 22:59:25 GMT

Among all the systems Poplog is available for, I didn't see NeXT. At
present, the NeXT has no common lisp available at all (except AKCL),
since Franz seems to have lost interest in supporting the version of
ACL that was once bundled with the machine (but is no more). I suspect
that if a reasonably priced poplog system were available for the
machine, a disproportionate number (out of the otherwise comparatively
small installed base) of users might buy it just to get the
lisp....and then learn how nice pop is, too.

This comment actually belongs in another thread, about
ease-of-learning and the utility of the system, but I'm too lazy to
make another posting:

Some years ago I installed poplog on the Sun 2's we had in the UCLA
linguistics department. The amount of pedagogy included in the system
(tutorials and a really nice interface between them and the rest of
the system) was so well done that I was able to take a class of
graduate students who barely knew how to log in (and certainly knew
NOTHING about programming), teach them to type "help help", and come
back seven or eight weeks later to find they had written serious
programs to do word-structure analysis on a variety of exotic
languages.

--Steve Anderson
From: lpb@cs.bham.ac.uk (Luc Beaudoin)
Newsgroups: comp.lang.pop
Subject: A tip: using exitto while debugging
Keywords: help * control
Date: 22 Nov 92 17:53:34 GMT
Organization: School of Computer Science, University of Birmingham, UK

The following probably occurred to most of you, but in case it's useful
to someone, I'm mentioning it.

It is sometimes very convenient within the context of a procedure held
in the variable * INTERRUPT , such as debugger_interrupt (cf HELP *
DEBUGGER) to (eventually) EXITTO a calling procedure rather than let
the call to SETPOP take place. This is especially convenient when
debugging a program which takes time to get into a particular state
which you're studying. If the call to the interrupt procedure follows a
MISHAP, it's sometimes useful to fix the cause of the mishap, then to
exitto a calling procedure.

It's easy to do this kind of thing in the debbuger, which permits you to
examine the call stack by using the BACKTRACE command. In the following
example, during the execution of debugger_interrupt, I examined the call
frame and decided to exitto run.

debug(1): backtrace
> [ 1] debugger_interrupt
  [ 2] mishap
  [ 3] nmMonitorSched(sched:NmSchedule)  (line 625)
  [ 4] nmRun(nm:NmNursemaid)  (line 1043)
  [ 5] nursemaid_interface  (line 2454)
  [ 6] run  (line 278)
  [14] compile
  [19] runproc
  [27] runproc
  [37] compile
  [39] setpop
debug(1): :exitto(run);

(The  debugger as it stands only allows you to return from the current
procedure, not an arbitrary procedure.)

If you're not using the debugger, you could assign a procedure like the
following to interrupt.

define myinterrupt();
/*  exitto a procedure in syscallers, or just exit */
    lvars callers = syscallers();
    define valid_index(i);
        i.isinteger and i>0 and i <= callers.length
    enddefine;

    vars i;
    for i from 1 to
        callers.length do
        [[^i]% callers(i)%]=>
    endfor;
    getline('Input index to exitto')-> i;
    if i matches [?i:valid_index] then
        exitto(callers(i))
    else
        [Wrong input!]=>
    endif;
enddefine;

Of course, this kind of thing doesn't always make sense, e.g., if
results are expected on the stack.

Luc
-- 
-------------------------------------- -----------------------------------
Luc Beaudoin                          |  School of Computer Science
E-mail: lpb@cs.bham.ac.uk             |  University of Birmingham
voice:  +44 (21) 414-4766 or 3743     |  Birmingham B15 2TT, UK
From: sfk@otter.hpl.hp.com (Steve Knight)
Date: Wed, 18 Nov 1992 11:27:24 GMT
Subject: Re: FTP'able pop for msdos
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Newsgroups: comp.lang.pop

Chris writes:
> Pop is available
> 	* inside Poplog, which runs on various Unix engines and VMS; perhaps
> 	some other systems which Aaron or Steve can remind me of;
> 	* as AlphaPop, which runs on the Mac;

For the benefit of netters who aren't familiar with the Pop family, I'd
like to add that POP-11 (Poplog's version) is currently viewed as the
most advanced and "definite" version.  However, there's an interesting
Expert System development environment called MUSE which uses a Pop
variant:  PopTalk -- a commercial object-oriented Pop derivative 
available from Cambridge Consultants.  I think PopTalk is written in C
and is therefore likely to be portable to a variety of platforms.  But
I've no up to date info on this & I don't think that CCL is on the net.
When I am recovered from this wretched cold I'll make an effort to 
chase up this info and add it to the proto-FAQ.

> There's also a Pop look-a-bit-like called Glo (Glow?) 

Definitely called GLOW.  Definitely on the PC.  Reviewed in the UK section
which is why no one spotted it.  

> Some person somwhere was rumoured to be doing a Pop look-fairly-like called
> Saffron, or Karl, or Salt. Something like that. But I don't think they've done
> anything with it recently. Lazy frogs.

So, Chris, when is Pepper going public?  (Karl??  Oh, Karl Popper.)

Steve
From: axs@cs.bham.ac.uk (Aaron Sloman)
Newsgroups: comp.lang.pop
Subject: Re: Poplog for the  SPARCclassic(TM) running Solaris 2.x
Date: 13 Nov 92 23:39:54 GMT
Organization: School of Computer Science, University of Birmingham, UK

lpb@cs.bham.ac.uk (Luc Beaudoin) writes:

> Organization: School of Computer Science, University of Birmingham, UK
> Date: Fri, 13 Nov 1992 11:37:02 GMT
>
> Does anyone know if we should expect Poplog to run under Sun's new
> SPARCclassic(TM) running Solaris 2.x. (I can send you a description of
> it if you haven't heard of it. It's a 59 MIP low cost machine to compete
> with 486 PC platforms) I've asked Sun about general binary compatibility
> between SPARCclassic(TM) running Solaris 2.x and, e.g., an SS10 SunOs
> 4.1 and they said:

Solaris is a new operating system. There's no reason to expect that
SunOS poplog will run under it. However, I believe Sussex University
(in collaboration with Integral Solutions Ltd, the main distrbutor)
are porting Poplog to Solaris.

> Does Poplog make use of architecture dependent features (e.g., machine
> registers)? Do you think it would be difficult to put the source on the
> machine and compile it? Could I as a user do this if I were to buy one
> of these machines?

Poplog Pop-11 (unlike some other implementations of Pop-11) has a
full incremental compiler. User procedures are compiled all the way
to machine code, for speed of execution. So yes it makes use of
architecture dependent features. However, that's not likely to be
a problem -- the new SPARC systems almost certainly are compatible
with the old at that level. The main problem is likely to be OS
changes e.g. system calls and perhaps directory structures.

> Perhaps it would be a good marketing move to port Poplog to this machine
you mean operating system....
> (when it appears!). Anyone else out there beside myself might be tempted
> by a full Poplog machine at home for the price of a PC!?

plus the price of Poplog. It isn't free! (Fee income is used to pay
for the development work.)
Aaron
-- 
Aaron Sloman, School of Computer Science,
The University of Birmingham, B15 2TT, England
EMAIL   A.Sloman@cs.bham.ac.uk  OR A.Sloman@bham.ac.uk
Phone: +44-(0)21-414-3711       Fax:   +44-(0)21-414-4281
From: sfk@otter.hpl.hp.com (Steve Knight)
Date: Thu, 19 Nov 1992 19:02:54 GMT
Subject: Re: Re: Re: help [Real time and Pop-11]
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Newsgroups: comp.lang.pop

Many thanks to Aaron Sloman for clarifying some of my earlier remarks.
I'd like to continue one point, though, on the subject of run-time
sizes.  I suggested that the run-time size for POPLOG was approximately
0.5 Mb :-

> > For example,
> > the richest and most complex implementation (POP-11) has a run-time
> > executable of approximately 500Kb.

Aaron pointed out that the latest version of POP-11 with all the
hooks for development comes to nearly 2.0Mb.

> That's a bit out of date: The latest distributed version of Pop-11
> (in Poplog V14.1) with hooks for X, and including the incremental
> compiler, the integrated editor VED (similar in philosophy and
> programmability to Emacs), the core of prolog, etc. is a nearly four
> times that size on a typical RISC machine. E.g. on a SPARC

This is all correct.  The difference between our remarks is that I was
stating the base size for *delivery* of an application rather than
the typical size for *development*.  Our typical applications don't
use X-windows or the integral editor, so we are therefore able to work
with images of greatly reduced size.

It is also worth noting that, like many UNIX applications, the advent
of shared libraries will make it unnecessary to have separate executables
in the near future.  Another factor of interest will be POPC -- but that's
a topic best left to another note.

Steve
From: sfk@otter.hpl.hp.com (Steve Knight)
Date: Mon, 16 Nov 1992 12:11:45 GMT
Subject: Re: PD Pop for the Mac?
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Newsgroups: comp.lang.pop

In comp.lang.pop, jack@dcs.glasgow.ac.uk (Jack Campin) writes:
> Is there a public-domain Pop for the Mac?  (*NOT* under MPW, please God).

I'm afraid not ... the nearest offer is AlphaPOP marketed by Cognitive
Applications for 300 pounds ($500?).  This system is fine for learning
Pop but not good enough for writing applications, unfortunately.  I
consider the price too steep -- I hope CogApp decide to drop the price
to something reasonable such as $50.

Steve
From: lpb@cs.bham.ac.uk (Luc Beaudoin)
Newsgroups: comp.lang.pop
Subject: Re: A little Pop history
Date: 14 Nov 92 22:37:57 GMT
Organization: School of Computer Science, University of Birmingham, UK

bh@anarres.CS.Berkeley.EDU (Brian Harvey) writes:

> Can this be right?  It looks to me as if it'll say that X isn't
> a recursivemember of [[A B C] [X Y Z]] because it isn't in the
> first sublist.

Yep.

Luc
-- 
-------------------------------------- -----------------------------------
Luc Beaudoin                          |  School of Computer Science
E-mail: lpb@cs.bham.ac.uk             |  University of Birmingham
voice:  +44 (21) 414-4766 or 3743     |  Birmingham B15 2TT, UK
Newsgroups: comp.lang.pop
From: ianr@syma.sussex.ac.uk (Ian Rogers)
Subject: Free-listing closures
Keywords: efficiency vs elegance
Organization: University of Sussex at Brighton
Date: Mon, 23 Nov 1992 12:44:51 GMT


Luc,

I just realised I was making a dreadful assumption in my
closure freelisting stuff. Namely:

    If you're making a closure of procedure that you've closed
    before, then you'll also be closing the same number of
    arguments as before.

This is wrong of course. A closure should only be free-listed with
repect to the number of closed arguments. I didn't know it was
possible to find out that information, but dredging through the
documentation reveals that -datalength- will do the trick:

    datalength(identfn(% 1, 2 %)) =>
    ** 2

So a rewrite of my code is

    define lconstant pdr_table =
        newproperty([], 8, [], "tmpboth")
    enddefine;

    define make_closure(n) -> clos;
        lvars   n, i, args, free, clos, pdr,
            ;
        conslist(n) -> args;    ;;; get the rest of the stuff
        () -> pdr;              ;;; from the stack
        pdr_table(n) -> free;   ;;; index the table with the number
                                ;;; of frozvals
        if free == [] then
            ;;; just like before
            partapply(pdr, args) -> clos;
        else
            destpair(free) -> pdr_table(n) -> clos;
            1 -> n;
            for i in args do
                i -> frozval(n, clos);
                n + 1 -> n;
            endfor;
            pdr -> pdpart(clos);    ;;; need to assign the new base
                                    ;;; procedure to the closure
        endif;
        sys_grbg_list(args);
    enddefine;

    define free_closure(clos);
        lvars   clos, n = datalength(clos),
            ;
        clos :: pdr_table(n) -> pdr_table(n);
    enddefine;


Some extra code will be needed if the closures have updaters.

axs@cs.bham.ac.uk (Aaron Sloman) writes:
> for Poplog V13.6)). Steve Knight has been arguing for ages that the
> mechanism should be generalised, and he is right. On the other hand
> you are right that users *can* do it themselves to reduce garbage
> collections, if they know enough. (Sometimes I think that if they
> need to be told how to do it then they don't know enough to do it
> safely!!!)

Ok guv, it's a fair cop :)

Ian.