maps and unions

B

Barry Schwarz

Why do people talk about unions/maps as the same subject?


Why not ask someone who does so? According to google, no one has done
so here in the last 15 months.
 
L

Larry Gates

Why not ask someone who does so? According to google, no one has done
so here in the last 15 months.

I tried to do a google advanced search today. It went poorly.

http://groups.google.com/advanced_search

I searched for quicksort in comp.lang.fortran in the last couple years and
got no hits. I can't remember what pseudonym I had at the time (less than
2 years ago), so I can't search for author.

What's trange is to get one or zero results from google as opposed to
128,000 of them, most of which have nothing to do with the search.:-(
--
larry gates

Python's syntax succeeds in combining the mistakes of Lisp and Fortran.
I do not contrue that as progress.
-- Larry Wall in <[email protected]>
 
T

Thad Smith

Larry said:
Why do people talk about unions/maps as the same subject?

My guess is that unions can be used to map one representation onto
another, such as mapping a structure onto an array of unsigned char.
 
R

Richard Bos

Larry Gates said:
It came up in c.l.f. I wonder if what they mean is C-style unions and
perl-style maps.??

Why is clari.local.florida discussing programming techniques?
Alternatively, why do you care how a bunch of forthheads confuse two
languages they do not understand?

Richard
 
L

Larry Gates

Why are you asking us, instead of c.l.f?

I thought I was gearing up to a little C-fortran interop, but it was one of
those things that just got lost between languages.
 
L

Larry Gates

Why is clari.local.florida discussing programming techniques?
Alternatively, why do you care how a bunch of forthheads confuse two
languages they do not understand?

Richard

The person meant vax-style unions and nothing with maps.

I can't speak for Florida. Carl Hiassen, one of its best authors, captures
the insanity of that state.

What does forth have to do with either fortran or perl?
--
larry gates

Chip Salzenberg sent me a complete patch to add System V IPC (msg, sem and
shm calls), so I added them. If that bothers you, you can always undefine
them in config.sh. :) -- Larry Wall in <[email protected]>
 
J

James Kuyper

Chris said:
That's not an example.

If you happen to guess that c.l.f means comp.lang.fortran, it may be
sufficient to locate an example using google (it was sufficient
yesterday; the same exact search failed this morning - that's GG for
you). I turns out that Larry Gates has finally followed the advice that
he's been given, and asked his question of the person who talked about
them. It's still not clear why he ever bothered asking anyone else.
 
L

Larry Gates

If you happen to guess that c.l.f means comp.lang.fortran, it may be
sufficient to locate an example using google (it was sufficient
yesterday; the same exact search failed this morning - that's GG for
you). I turns out that Larry Gates has finally followed the advice that
he's been given, and asked his question of the person who talked about
them. It's still not clear why he ever bothered asking anyone else.

I've heard of maps and unions talked about in the same breath, most
recently in c.l.f, where Gary meant "vax style unions". I've been trying
to understand what a map could have to do with a union, but since I don't
understand either, maybe I should take them one at a time.

In K&R §6.8, the example code is
union u_tag {
int ival;
float fval;
char *sval;
} u;

After it is initialized, is there a single value stored for u?
 
R

Richard Bos

Larry Gates said:
In K&R §6.8, the example code is
union u_tag {
int ival;
float fval;
char *sval;
} u;

After it is initialized, is there a single value stored for u?

That code does not initialise anything. However, if it did, or if later
code assigned any value to any member of u, then yes, there would be a
single value stored for u. For example, if you do

u.ival=5;

then the value stored in u is that value. Also, at that point, the
values of u.fval and u.sval become (essentially) undefined.

Richard
 
L

Larry Gates

That code does not initialise anything. However, if it did, or if later
code assigned any value to any member of u, then yes, there would be a
single value stored for u. For example, if you do

u.ival=5;

then the value stored in u is that value. Also, at that point, the
values of u.fval and u.sval become (essentially) undefined.

Richard

Ok I get it.

What a time for Hollaender Baseball! In Europe, I was shadowed by Dutch
antiterrorism folks. I've seen them lose to Berkeley. Tja.

Nun hab ick wat zu reden: Ihr seid "peculiar people".
--
larry gates

Q. Why is this so clumsy?
A. The trick is to use Perl's strengths rather than its weaknesses.
-- Larry Wall in <[email protected]>
 
R

Richard Bos

Larry Gates said:
What a time for Hollaender Baseball!

Who gives a shit? Both Hollanders and rounders are sub dignitate for
civilised people.
In Europe, I was shadowed by Dutch antiterrorism folks.

I'm not surprised, with the broken way you try to speak real languages.

See what I mean?

Richard
 
R

Richard Bos

Larry Gates said:
And how would you render 1 Peter 2:9?

I would not even approach your peter without a full-size caber, a bucket
of creosote, and a pair of industrial-strength safety gloves - let alone
"render" it.
How do I know portugese?

I do not care to share my C's
With jellyfishes such as these,
Particularly Portuguese.
-- not quite Flanders & Swann

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top