HDTenEightyP/NetNews huggingface dataset:
From: jamshid@ut-emx.uucp (Jamshid Afshar)
Newsgroups: comp.lang.c++
Subject: Re: BC++ templates broken
Summary: a workaround
Date: 2 Sep 92 17:01:17 GMT
Reply-To: jamshid@emx.utexas.edu
Organization: The University of Texas at Austin; Austin, Texas

In article <1992Aug31.155313.5879@fcom.cc.utah.edu> swillden@news.ccutah.edu (Shawn Willden) writes:
>[BC++ and gcc-2.2.2 barf on code like:]

 	template<class T> class A1;
 	template<class T> class A2;
 	
	template<class T> class A { A1<T>* a; A2<T>* b;};
	//here

 	template<class T> class A1 : public A<T> {};
 	template<class T> class A2 : public A<T> {};
 
 	main() {A1<int> myA1;}

>Am I asking something too difficult?

I hope not.  ANSI C++ will require that cases such as this are handled
properly, right?  Does cfront 3.0 handle it?  I reported this bug a
couple of weeks ago to bugs@borland.com (not for tech. support) and
the TCPLUS-L mailing list.  To subscribe, send mail to
listserv@ucf1vm.cc.ucf.edu containing the line "subscribe tcplus-l
Your Name".  I'll send you a copy of my BC++ 3.1.  If anyone else
wants them, just email me.

The workaround (that possibly works under gcc too) is to instantiate
the first template before the compiler sees the full definition of the
"forward declared" templates.  So, add at line "//here" above
	typedef A<int> Hack_Aint;
	typedef A<double> Hack_Adouble;
	//...instantiate any other A<T>s you'll be using in your program...

A hassle, but better than no templates at all.  Let me know if there's
any problems.

Jamshid Afshar
jamshid@emx.utexas.edu
From: davidm@consilium.com (David S. Masterson)
Newsgroups: comp.lang.c++
Subject: Re: File I/O using C++ (write/read objects...)
Date: 26 Aug 92 20:29:38 GMT
Organization: Consilium Inc., Mountain View, California
In-reply-to: jetherid@gucis.cit.gu.edu.au's message of 26 Aug 92 02:32:55 GMT
X-Posting-Software: GNUS 3.13  [ NNTP-based News Reader for GNU Emacs ]

>>>>> On 26 Aug 92 02:32:55 GMT, jetherid@gucis.cit.gu.edu.au (Jason
>>>>> Etheridge) said:

> I am having real problems reading and writing objects to a file.  A text
> I have uses

> 	out.write((unsigned char*) &object, sizeof(OBJECT))

> where out is an fstream that allows writing to the file it is open for,
> and object is an object of class OBJECT.

> It writes the object, seemingly with no problems, but when I try and read
> it back in the resulting object has been garbled, it's attributes changed
> with the occasional garbage character.

> Strangely enough, if I try this with an object with no functions, it
> works perfectly.

Offhand, I would guess that your object has pointers in it (possibly virtual
pointers).  Pointers, no matter how you look at them, are memory references
and those references are not persistent (they change from invocation to
invocation).  Also, in doing the "block write" that your doing above, you are
not saving anything that the object points to.

As far as I've seen, there is no automatic, reliable approach to writing a C++
object to a file (or sending it in a message).  It requires knowing what the
format of the object internally looks like and, possibly, converting this
internal format into a format that is persistent.

The only generic, portable approach to doing this that I've seen is what I'll
call "linearization" of an object.  That is, when object wants to write itself
onto a stream (as defined by operator>>), it converts itself into a stream of
bytes that will be recognizable on the other end of the stream (so that
operator<< will understand it).  With these operators defined on every object,
newly derived objects simply worry about their internal structure and call the
appropriate superclass method to handle the rest.  The drawback with this is
that it suggests a Smalltalk approach to creating objects (everything derives
from the central controlling Object).  Naturally, there are a lot of little
"gotchas" in this that must be worked out (like peeking into a stream and
making a guess about what the next object is that's coming out of the stream
so that the appropriate object may be constructed).

Comments?
--
====================================================================
David Masterson					Consilium, Inc.
(415) 691-6311					640 Clyde Ct.
uunet!cimshop!davidm				Mtn. View, CA  94043
====================================================================
Newsgroups: comp.lang.c++
From: vijghen@fynu3.fynu.ucl.ac.be (Philippe Vijghen)
Subject: Re: BC 3.1 TV Running slow ?
Organization: Free University of Brussels (ULB) - Astrophysic Dpt.
Date: Thu, 27 Aug 1992 07:35:30 GMT

In article <1992Aug19.232224.3557@cssc-woll.tansu.com.au> greg@cssc-woll.tansu.com.au (Pengelly Greg) writes:
>
>
>Problems with Turbo Vision V3.1
>
>We have a reasonably large TV application developed under BC V3.0
>Compiled under BC V3.1 it runs like a dog. 
>The application now runs noticably slower. 
>Compiler switches and source code have not been changed.
>
>Has anyone else had this problem. Better still can anyone provide the 
>solution.  Help from Borland Australia has sofar been nonexistant.
>

I had the same problem with a Turbo Vision application and BC++ 3.0
compiler. I looked around for a long time and I found that the source
of the problem is the memory allocation mechanism: it uses a kind of
"safe pool" and a lot of verifications; this certainbly provide advantages
but the main result is a important reduction of the speed inside the
routines using dynamic memory allocation (I was doing some symbolic
computation to implement a fuzzy logic controller).

The only solution I found was to do an "execvp(...)" call to a non
Turbo Vision excutable! I think another one should be to rewrite the
allocation function new (Yes, it's possible because Borland provides
the source of every single function of his libraries!) ...but the
code should'nt be as portable.

The execvp() was not a problem for my applications because the computation
time was in days on a 486!!! (because of a Genetic Algorithm optimisation
with a trcky fitness function...) I understand that for other applications
it should not be a good solution. 

I think that Borland should put an option in his library: speed/security
for the mem. alloc., don't you?

Anyway, I really enjoy the Borland C++ package (I am waiting for an upgrade
to the version 3.1) and I think that no compiler is going better an better
as it does.

	Philippe VIJGHEN
	Ingenieur Civil Mecanicien et Electricien (AIrBr)
	Free University of Brussels (ULB)
	Astrophysic -Dpt.

	e-mail: vijghen@fynu.ucl.ac.be
Newsgroups: comp.lang.functional
From: aet@mullian.ee.mu.OZ.AU (bert thompson)
Subject: transcendental functions in Gofer
Organization: Computer Science, University of Melbourne, Australia
Date: Wed, 26 Aug 1992 08:07:04 GMT


hi!

has anyone implemented any functions in Gofer to do any of the following on Floats:

sqrt exp log sin atan erf

the sqrt is easy, but the limited support for Floats in Gofer means that the others
are hard to do adequately.

btw, i don't mind if you've use `primitive' to define them in the interpreter itself.
even if you don't have code, hints would be good. i don't have problems with the
numerical analysis, but the absence of functions to return the exponent and mantissa
of a Float is a real problem. (perhaps Mark Jones might consider defining such
functions a la Haskell in the next release?)

many thanks!

	bert.
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.functional
Subject: Re: pairs vs. triples
Date: 28 Aug 92 15:24:46 GMT
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Murray Hill NJ

In article <1992Aug26.141437.8465@swift.cs.tcd.ie> butrfeld@swift.cs.tcd.ie writes:

> In a language called Sticks&Stones, based loosely on ML, that I have
> used, the following equality always held:

> (a,(b,c)) = (a,b,c)

> In other words a triple is simply a pair whose second item is a pair.
> Note that ((a,b),c) is not a triple.

It sounds like that language didn't allow triples at all, only pairs.
It's certainly possible to do that, but that would certainly be less
convenient in other ways.

For example, in ML a pair is a special case of a more general record
type that consists of name-value pairs known and checked at compile
time.  A pair is just a record whose components are named 1 and 2;
a triple is a record with components named 1, 2, and 3, and so on.
I don't see how to allow pairs and not triples with that kind of
unified design, and that unification is truly elegant and makes
all sorts of other things easier to understand.
-- 
				--Andrew Koenig
				  ark@europa.att.com
Newsgroups: comp.lang.functional
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: About function middle using primitive recursion
Keywords: help
Organization: Computer Science, University of Melbourne, Australia
Date: Wed, 2 Sep 1992 19:55:15 GMT

ojuarez@mtecv2.mty.itesm.mx (Octavio Juarez Espinosa) writes:

>I am very interested in to receive some version for funtion middle.
>
>(middle list)  return nil if is even number of elements.
>		return the element if is odd the number of elements
>
>Constrains:
>Only one recursion call and only with the CRD of argument.

I don't quite understand why you want to return "nil" when the
list has an even number of elements. If you are applying the
function to a list of numbers, then "nil" is not a number, so
it won't work for strongly typed languages; if you are applying
the function to a list of lists, then you can't tell whether
the function worked or not. Much better to return either a tagged
value (Ok val | Error message) or to raise an exception for even
length lists. The following code completely ignores the issue for
simplicity.

NB. all these functions are "primitive recursive" in the original poster's
sense.

tail' [] = []
tail' (x:xs) = xs

middle_odd [] ys = tail' ys
middle_odd (x:xs) ys = middle_odd (tail' xs) (tail' ys)

middle l = middle_odd ([] : l) l

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
From: okokjt@uts.uni-c.dk (Jeppe Traberg)
Newsgroups: comp.lang.functional
Subject: ibmpc versions of sml and caml wanted
Date: 28 Aug 92 14:17:58 GMT
Organization: UNI-C, Danish Computing Centre for Research and Education

Can anyone help me with pc-versions of sml and caml.


Kind regards

Jeppe Traberg
Center for Applied Computer Science
Copenhagen University

email jt@pc.ibt.dk
From: brendan@cs.uq.oz.au (Brendan Mahony)
Newsgroups: comp.lang.functional
Subject: Re: Nondeterministic expressions & refinement calculus
Date: 28 Aug 92 02:11:54 GMT
Reply-To: brendan@cs.uq.oz.au


Also of interest:

@article{Morris:ExpRef,
        author = {J. M. Morris},  
        title = "Programming by Expression Refinement: A Series of Examples",
        journal = {Structured Computing}, 
        volume = 11, 
        pages = {189--197}, 
        year = 1990 
}
--
When soldiers form lines or hollow squares, you call it reason.
When wild geese in flight take the form of a letter V, you say instinct.
When the homogeneous atoms of a mineral arrange themselves into shapes
mathematically perfect you have nothing to say. You have not even invented a name to conceal your heroic unreason."
From: ojuarez@mtecv2.mty.itesm.mx (Octavio Juarez Espinosa)
Newsgroups: comp.lang.functional
Subject: About function middle using primitive recursion
Summary: help
Keywords: help
Date: 2 Sep 92 15:38:31 GMT
Organization: I.T.E.S.M. Campus Monterrey



Hi,

I am very interested in to receive some version for funtion middle.

(middle list)  return nil if is even number of elements.
		return the element if is odd the number of elements

Constrains:
Only one recursion call and only with the CRD of argument.

Thanks in advance.

Sincerely,

Octavio Juarez Espinosa.
ojuarez@mtecv2.mty.itesm.mx

-- 
Octavio Juarez Espinosa
Gabriel Valerio 1134 
Saltillo, Coahuila    CP 25000
Mexico  email ojuarez@mtecv2.mty.itesm.mx
Newsgroups: comp.lang.functional
From: gupta@nmsu.edu (Gopal Gupta)
Subject: Logic Programming an Introductory Programming Paradigm
Organization: NMSU Computer Science
Date: Wed, 26 Aug 1992 15:44:29 GMT

		       Call for Participation

		Logic Programming as an Introductory
			Programming Paradigm

		Informal Birds-of-a-Feather Session
		
		Joint International Conference and 
		Symposium on Logic Programming '92

		      Tuesday, Nov 10th, 1992
			   6:00PM -- 8:30PM

		  Organizers: J. Reinfelds and G. Gupta

This informal session is  devoted to  discussion on  using  the  logic 
programming  paradigm to teach programming to beginners. The  emphasis 
is on  teaching  logic  programming (rather than Prolog), and  the aim 
is to induce beginners to learn ``declarative thinking." This approach 
can be  contrasted with  the functional programming  approach that has 
been becoming increasingly popular recently.

The discussion  is open to  all the participants in the conference who 
are  invited  to present  their  views on  (but  not  limited  to) the 
following issues:

1) Why is  Logic  Programming  a  more  suitable paradigm for teaching 
	programming to beginners?
2) Is there a need for  using LP for this purpose, or is FP enough, or
	is some other approach better?
3) How to evaluate the success of such an enterprise?
4) Your  experiences  related  to  using  LP  to  teach programming to
	beginners.

Dissenting views are specially welcome.  

As part of the session  we will  relate our  experience  with using LP 
(and a closely co-ordinated  sister course in discrete Math and Logic) 
to teach programming to Freshman students  at New Mexico State. Others 
are welcome to relate their experiences too. 

Please note  that the primary focus of the session will be on teaching 
logic programming to beginner programmers. Discussion related to teach-
ing Logic Programming to people other than beginners is not encouraged.

Please  send email (to gupta@nmsu.edu  or  juris@nmsu.edu) if  you are 
interested in participating. Please indicate in your email if you just 
want to attend the session or  whether you  intend to  present a short 
position paper too.


---------------------------------------------------------------------
Gopal Gupta
Department of Computer Science	   email: gupta@nmsu.edu
Box 30001, Dept. 3CU		      	  gupta@compsci.bristol.ac.uk
New Mexico State University	   Ph: +1 (505) 646 6236 
Las Cruces, NM 88003-0001	   Fax: +1 (505) 646 6218
USA
---------------------------------------------------------------------

	 
Newsgroups: comp.lang.functional
From: rhyspj@occs.cs.oberlin.edu (Rhys Price Jones)
Subject: Soliciting names for ACM/SIGCSE panelists
Organization: Oberlin College Computer Science
Distribution: comp
Date: Wed, 2 Sep 1992 22:19:10 GMT
X-Posted-From: occs.cs.oberlin.edu
X-Posted-Through: sol.ctr.columbia.edu

I am looking for participants in a panel discussion  for next year's
SIGCSE to discuss issues affecting choice of language in CS1 - the
introductory CS course.  Please e-mail me suggested names for
advocates of your particular favorite introductory language.

Thanks

--
Rhys Price Jones                            
Cyd-athro Cyfrifiaduriaeth                   ____
Associate Professor Computer Science        /   / /
Oberlin College                            /   / /
King 223C                                 /___/ /__      __
Oberlin OH 44074 - USA - UDA             / \   /  / / / (
(216) 775 8697                          /   \_/  /_/_/ __)
<rhyspj@occs.cs.oberlin.edu>                      __/_/
From: butrfeld@swift.cs.tcd.ie
Newsgroups: comp.lang.functional
Subject: pairs vs. triples
Date: 26 Aug 92 14:14:37 GMT
Organization: Computer Science Department, Trinity College Dublin


Can anyone explain the following aspect of the Miranda and Haskell type
systems that I find annoying ? Is there a theoretical reason for it ?

pairs, triples, quintuples, etc.. are _distinct_ types. In particular,
(a,(b,c)) != ((a,b),c) != (a,b,c).

In a language called Sticks&Stones, based loosely on ML, that I have
used, the following equality always held:

(a,(b,c)) = (a,b,c)

In other words a triple is simply a pair whose second item is a pair.
Note that ((a,b),c) is not a triple.

Why is this convenient and the other approach annoying ?

Recently, while experimenting with Miranda, I called some standard
function which returned a triple. I then found that I could not access
the components of that triple from the interactive session, without
writing a script to provide triple analysis functions. This is
frustrating when trying to interactively explore the std environment.
The functions "fst" and "snd" can only be applied to pairs.

In Sticks&Stones I could access the three elements of the triple (a,b,c)
with the following calls to built-in functions:

fst (a,b,c)  --- returns a
fst(snd(a,b,c)) --- returns b
snd(snd(a,b,c)) --- returns c

Why is something like this not allowed in Miranda/Haskell ? Is it a
result of the type inference schemes used here. Sticks&Stones is
polymorphic, but does run-time type checks.

Awaiting your commments with interest,
					Andrew Butterfield

Dept. of Comp. Sci., Trinity College, Dublin 2, Ireland
email: butrfeld@cs.tcd.ie
Newsgroups: comp.lang.functional
From: dziadzka@informatik.hu-berlin.de (M.Dziadzka)
Subject: Re: ibmpc versions of sml and caml wanted
Organization: Humboldt University, Department of Computer Science
Date: Mon, 31 Aug 1992 07:24:13 GMT

In article <1992Aug28.141758.91@uts.uni-c.dk> okokjt@uts.uni-c.dk (Jeppe Traberg) writes:
>Can anyone help me with pc-versions of sml and caml.


Try ftp.uni-regensburg.de /software/pc/sprachen/sml

Mirko
-- 
Mirko Dziadzka 		        e-mail: try one of:
Humboldt-University Berlin, 	dziadzka@hp832.informatik.hu-berlin.de
Department of Computer Science  dziadzka@informatik.hu-berlin.de
Newsgroups: comp.lang.functional
From: muts@fysap.fys.ruu.nl (Peter Mutsaers)
Subject: What strongly typed fun. language to start with?
Organization: Rijks Universiteit Utrecht
Distribution: comp
Date: Mon, 31 Aug 1992 15:31:37 GMT


Hello,

I would like to experiment and get known with a strongly typed
functional language, such as hope. Who can recommend one, considering
availability of PD compilers for unix, good book(s), and suitability
for a beginning hobbyist in this field?

Thanks in advance,
--
_________________________________________________________________________
Peter Mutsaers.         |================================================ 
muts@fys.ruu.nl         |              Memento Mori
Newsgroups: comp.lang.functional
From: fjh@mundil.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: transcendental functions in Gofer
Organization: Computer Science, University of Melbourne, Australia
Date: Wed, 26 Aug 1992 13:33:53 GMT

aet@mullian.ee.mu.OZ.AU (bert thompson) writes:

>has anyone implemented any functions in Gofer to do any of the following
>on Floats:
>
>sqrt exp log sin atan erf
>
>btw, i don't mind if you've use `primitive' to define them in the interpreter
>itself.
Wed Aug 26 23:24:55 EST 1992

I haven't done these ones myself, but it is VERY easy to add new primitives.

Just add lines like
	primitive "primitiveExpFloat" exp :: Float -> Float
to the prelude, add functions like

/* one-argument example */
primFun(primExpFloat) {	       /* Float exp primitive	   */
    eval(primArg(1));
    updateRoot(mkFloat(sin(whnfFloat)));
		       ^^^ substitute as appropriate
}

/* two-argument example */
primFun(primAtan2Float) {	      /* Float atan2 primitive	   */
    Float x;
    eval(primArg(2));
    x = whnfFloat;
    eval(primArg(1));
    updateRoot(mkFloat(atan2(x,whnfFloat)());
		       ^^^^^ substitute as appropriate
}

to "builtin.c", add these functions to the table of builtin functions
in builtin.c, and then just run "make".

P.S. If you have any trouble, I'd be happy to give you a hand.

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Newsgroups: comp.lang.functional
From: ramaer@cs.utwente.nl (Mark Ramaer)
Subject: Re: About function middle using primitive recursion
Keywords: help
Organization: University of Twente, Dept. of Computer Science
Date: Thu, 3 Sep 1992 10:22:41 GMT

In article <6006@mtecv2.mty.itesm.mx>, ojuarez@mtecv2.mty.itesm.mx (Octavio Juarez Espinosa) writes:
>I am very interested in to receive some version for funtion middle.
>
>(middle list)  return nil if is even number of elements.
>		return the element if is odd the number of elements

In article <9224705.24159@mulga.cs.mu.OZ.AU>, fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
...
|> the function worked or not. Much better to return either a tagged
|> value (Ok val | Error message) or to raise an exception for even
|> length lists. The following code completely ignores the issue for
|> simplicity.
|> 
|> NB. all these functions are "primitive recursive" in the original poster's
|> sense.
|> 
|> tail' [] = []
|> tail' (x:xs) = xs
|> 
|> middle_odd [] ys = tail' ys
|> middle_odd (x:xs) ys = middle_odd (tail' xs) (tail' ys)
|> 
|> middle l = middle_odd ([] : l) l
|> 

Sorry, but I tried out this function and it is not correct.
My attempt is (I return a singleton list on success):

middle l = even l l

even halfSpeed []     = []
even halfSpeed (x:xs) = odd halfSpeed xs

odd (midValue:halfSpeed) []     = [midValue]
odd (void    :halfSpeed) (x:xs) = even halfSpeed xs

Test:
Miranda [middle [1..n]|n<-[0..20]]
[[],[1],[],[2],[],[3],[],[4],[],[5],[],[6],[],[7],[],[8],[],[9],[],[10],[]]
Miranda ^D

By the way, I did not understand the constraint completely,
what means CRD?  Do you mean CDR, or as we LISP-haters say: tail?
You have to know the length of the list before you can decide what
element to return.

Mark Ramaer
From: andrew@vittra15.cs.chalmers.se (Andrew Moran)
Newsgroups: comp.lang.functional
Subject: Denotational semantics using metric spaces
Date: 27 Aug 92 11:30:39 GMT
Organization: Dept. of CS, Chalmers, Sweden

I'm interested in finding out more about the possibility of using
metric spaces instead of domains to model the lambda calculus,
particularly the non-deterministic lambda calculus.

Please e-mail any references you think are appropriate.
I will post a summary.

Thanks,

Andy

----------
"Hire you a horse?  For ninepence?  On Jewish New Year's Eve in the rain?  A
 bare fortnight after the dreaded horse plague of Old London Town?  With the
 blacksmith's strike in its fifteenth week and the Dorset Horse-Fetishists
 fair tomorrow?" -- Baldrick, dogsbody to the butler to the Prince Regent.
---------------
From: stanat@hatteras.cs.unc.edu (Don Stanat)
Newsgroups: comp.lang.functional
Subject: Need copies of Bird and Wadler
Date: 1 Sep 92 15:49:54 GMT

The term has begun, and my course in functional programming, which
uses Bird and Wadler: Introduction to Functional Programming, has
about 50 people rather than the 40 I judged to be max.  I need
about 10 more copies of the text.

Yes, I know about bookstores.  But Prentice-Hall now lists B&W as 'out
of print' in the U.S., and its warehouse is empty.  (My local P-H
salesman has been very helpful in checking things out.) Additional
copies will have to come from England with either a three week delay or
a premium price.

Any pointers to bookstores with multiple copies would be much
appreciated!  We need texts right now!  

Don Stanat
From: bloch@pasteur.fr (Laurent Bloch)
Newsgroups: comp.lang.functional
Subject: ibmpc versions of sml and caml wanted
Date: 4 Sep 92 14:25:47 GMT
X-Unparsable-Date: Fri, 4 Sep 92 16:23:58 MET DST

Newsgroups: comp.lang.functional