9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Compilation error??
@ 2001-05-30 23:09 jmk
  2001-05-31  2:38 ` Ish Rattan
  0 siblings, 1 reply; 9+ messages in thread
From: jmk @ 2001-05-30 23:09 UTC (permalink / raw)
  To: 9fans

On Wed May 30 18:57:33 EDT 2001, mike@ducky.net wrote:
> >you can't use typestr anymore.  it's a reserved word.
> 
> But what does it do?  I just spent a few minutes looking
> at the compiler source, and it was not obvious to me.

Typestr was one of the things to come out of Ken's parting
flurry of activity. Here's the complete documentation as we have
it from his show-and-tell a couple of days before he left:

#include	<u.h>
#include	<libc.h>

typestr	struct	_cmplx	Cmplx;
struct	_cmplx
{
	double	r;
	double	i;
};
int	Zconv(va_list*, Fconv*);

#pragma	varargck	type	"Z"	Cmplx

void
main(void)
{
	Cmplx a, b;
	int ia[10];
	double d;

	fmtinstall('Z', Zconv);
	a = (Cmplx){1, 0};
	b = (Cmplx){0, 1};

	a = -((a + b) - (b - a)) + -((a - b) - (b + a));
	print("a = %Z\n", a);
	a += b;
	print("a = %Z\n", a);

	if(a == a)
		print("ok\n");

	a = (d = a);
	print("d = %g\n", d);
	print("a = %Z\n", a);

	a = (Cmplx)1.0;
	print("a = %Z\n", a);
}

/*
 * print conversion
 */
int
Zconv(va_list *arg, Fconv *fp)
{
	char s[50];
	Cmplx z;

	z = va_arg(*arg, Cmplx);
	sprint(s, "(%g %g)", z.r, z.i);
	strconv(s, fp);
	return sizeof(z);
}

/*
 * operators
 */
Cmplx
_cmplx_pos_(Cmplx a)
{
	Cmplx r;

	r.r = +a.r;
	r.i = +a.i;
	return r;
}

Cmplx
_cmplx_neg_(Cmplx a)
{
	Cmplx r;

	r.r = -a.r;
	r.i = -a.i;
	return r;
}

Cmplx
_cmplx_add_(Cmplx a, Cmplx b)
{
	Cmplx r;

	r.r = a.r + b.r;
	r.i = a.i + b.i;
	return r;
}

Cmplx
_cmplx_sub_(Cmplx a, Cmplx b)
{
	Cmplx r;

	r.r = a.r - b.r;
	r.i = a.i - b.i;
	return r;
}

int
_cmplx_eq_(Cmplx a, Cmplx b)
{
	Cmplx r;

	return a.r == b.r && a.i == b.i;
}

/*
 * assignment-op (can be made from assig and op)
 */
Cmplx
_cmplx_asadd_(Cmplx *a, Cmplx b)
{
	*a = *a + b;
	return *a;
}

Cmplx
_cmplx_assub_(Cmplx *a, Cmplx b)
{
	*a = *a - b;
	return *a;
}

/*
 * conversions
 */
int
_cmplx_i_(Cmplx a)
{
	return sqrt(a.r*a.r + a.i*a.i);
}

double
_cmplx_d_(Cmplx a)
{
	return sqrt(a.r*a.r + a.i*a.i);
}

Cmplx
_d_cmplx_(double a)
{
	Cmplx r;

	r.r = a;
	r.i = 0;
	return r;
}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Compilation error??
  2001-05-30 23:09 [9fans] Compilation error?? jmk
@ 2001-05-31  2:38 ` Ish Rattan
  2001-05-31  3:23   ` philw
  0 siblings, 1 reply; 9+ messages in thread
From: Ish Rattan @ 2001-05-31  2:38 UTC (permalink / raw)
  To: 9fans

On Wed, 30 May 2001 jmk@plan9.bell-labs.com wrote:

> On Wed May 30 18:57:33 EDT 2001, mike@ducky.net wrote:
> > >you can't use typestr anymore.  it's a reserved word.
> >
> > But what does it do?  I just spent a few minutes looking
> > at the compiler source, and it was not obvious to me.
>
> Typestr was one of the things to come out of Ken's parting
> flurry of activity. Here's the complete documentation as we have

Does it mean he has left the scene finally? What a loss!!!

- ishwar



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [9fans] Compilation error??
  2001-05-31  2:38 ` Ish Rattan
@ 2001-05-31  3:23   ` philw
  2001-06-01  8:24     ` bs
  0 siblings, 1 reply; 9+ messages in thread
From: philw @ 2001-05-31  3:23 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

Ken is more active than he has been in a long time,
he's just not at Lucent anymore.

-----Original Message-----
From: 9fans-admin@cse.psu.edu [mailto:9fans-admin@cse.psu.edu]On Behalf
Of Ish Rattan
Sent: Wednesday, May 30, 2001 7:39 PM
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Compilation error??


On Wed, 30 May 2001 jmk@plan9.bell-labs.com wrote:

> On Wed May 30 18:57:33 EDT 2001, mike@ducky.net wrote:
> > >you can't use typestr anymore.  it's a reserved word.
> >
> > But what does it do?  I just spent a few minutes looking
> > at the compiler source, and it was not obvious to me.
>
> Typestr was one of the things to come out of Ken's parting
> flurry of activity. Here's the complete documentation as we have

Does it mean he has left the scene finally? What a loss!!!

- ishwar


[-- Attachment #2: Type: text/html, Size: 1772 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Compilation error??
  2001-05-31  3:23   ` philw
@ 2001-06-01  8:24     ` bs
  2001-06-01  8:46       ` Matt
  0 siblings, 1 reply; 9+ messages in thread
From: bs @ 2001-06-01  8:24 UTC (permalink / raw)
  To: 9fans

http://www.entrisphere.com/about.html

> philw wrote:
> 
> Ken is more active than he has been in a long time,
> he's just not at Lucent anymore.
> 
> -----Original Message-----
> From: 9fans-admin@cse.psu.edu [mailto:9fans-admin@cse.psu.edu]On
> Behalf
> Of Ish Rattan
> Sent: Wednesday, May 30, 2001 7:39 PM
> To: 9fans@cse.psu.edu
> Subject: Re: [9fans] Compilation error??
> 
> On Wed, 30 May 2001 jmk@plan9.bell-labs.com wrote:
> 
> > On Wed May 30 18:57:33 EDT 2001, mike@ducky.net wrote:
> > > >you can't use typestr anymore.  it's a reserved word.
> > >
> > > But what does it do?  I just spent a few minutes looking
> > > at the compiler source, and it was not obvious to me.
> >
> > Typestr was one of the things to come out of Ken's parting
> > flurry of activity. Here's the complete documentation as we have
> 
> Does it mean he has left the scene finally? What a loss!!!
> 
> - ishwar


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Compilation error??
  2001-06-01  8:24     ` bs
@ 2001-06-01  8:46       ` Matt
  0 siblings, 0 replies; 9+ messages in thread
From: Matt @ 2001-06-01  8:46 UTC (permalink / raw)
  To: 9fans




> http://www.entrisphere.com/about.html


shame they couldn't afford a web designer



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Compilation error??
@ 2001-05-31 11:08 rog
  0 siblings, 0 replies; 9+ messages in thread
From: rog @ 2001-05-31 11:08 UTC (permalink / raw)
  To: 9fans

> Typestr was one of the things to come out of Ken's parting
> flurry of activity. Here's the complete documentation as we have
> it from his show-and-tell a couple of days before he left:

/sys/src/cmd/cc/funct.c gives a further glimmer of illumination.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Compilation error??
  2001-05-30 21:31 Russ Cox
@ 2001-05-30 22:46 ` Mike Haertel
  0 siblings, 0 replies; 9+ messages in thread
From: Mike Haertel @ 2001-05-30 22:46 UTC (permalink / raw)
  To: 9fans

>you can't use typestr anymore.  it's a reserved word.

But what does it do?  I just spent a few minutes looking
at the compiler source, and it was not obvious to me.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Compilation error??
@ 2001-05-30 21:31 Russ Cox
  2001-05-30 22:46 ` Mike Haertel
  0 siblings, 1 reply; 9+ messages in thread
From: Russ Cox @ 2001-05-30 21:31 UTC (permalink / raw)
  To: 9fans

you can't use typestr anymore.  it's a reserved word.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Compilation error??
@ 2001-05-30 20:15 Ish Rattan
  0 siblings, 0 replies; 9+ messages in thread
From: Ish Rattan @ 2001-05-30 20:15 UTC (permalink / raw)
  To: 9fans

Hello,

The 3/27 upgrade broke the alef port from 2nd to 3rd edition. An invocation
of 8c (3/27 version) generates the following errors. Lines 85 to 95 in the
header file are shown below too. Replacing char *typestr[] by char **typestr
does not help.

Any ideas?

- ishwar
----
8c -w -I../port cinit.c
8c -w -I../port code.c
../port/globl.h:92 cinit.c:7 syntax error, last name: typestr
../port/globl.h:92 code.c:7 syntax error, last name: typestr
mk: 8c -w -I../port cinit.c  : exit status=rc 3302:8c 3306:errorExtern Hist*	his
-----../prot/globl.h---
Extern Node*	movenode;
Extern Node*	alefsig;
Extern Node*	checknode;

#define opt(s)		flag[s]

extern char*	treeop[];
extern char*	typestr[];

int	VBconv(void*, Fconv*);
Type*	abt(int);
----




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-06-01  8:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-30 23:09 [9fans] Compilation error?? jmk
2001-05-31  2:38 ` Ish Rattan
2001-05-31  3:23   ` philw
2001-06-01  8:24     ` bs
2001-06-01  8:46       ` Matt
  -- strict thread matches above, loose matches on Subject: below --
2001-05-31 11:08 rog
2001-05-30 21:31 Russ Cox
2001-05-30 22:46 ` Mike Haertel
2001-05-30 20:15 Ish Rattan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).