🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3878

Re: Pointers

#3878
From: peter da silva
Date: Thu, 19 Nov 1992 20:31
43 lines
2233 bytes
In article <mwm.2mx5@contessa.palo-alto.ca.us> mwm@contessa.palo-alto.ca.us (Mike Meyer) writes:
> (define name car)
> (define func cdr)
> (define handlers '(("plugh" . plughfunc) ... ))

Great. All the pointers are still there. Plus you've added an "address"
operator (quote) instead of the indirection operator.

> Note the added comments - did I assume correctly there?

Yes.

> That loop gets turned into:

> (do ((string (getline) (getline)))
>     ((or
>      (null? string)
>      (zero? ((lookup (firstword line) handlers) (remainder line))))))

Which is precisely the same code with all the same pointers.

All this does is change the syntax around minimally. It hasn't done anything
for the semantics. Where the semantics *do* change is that lisp is a much
safer language. That's got nothing to do with pointers.

> > (I will readily admit that C syntax sucks here: indirection should be a
> > postfix operator:

> Actually, there's no need for the indirection *at all* for any use of
> C function pointers.

Well, yes, but I'm talking in the general case. In any case, ANSI C has turned
(...) into an indirection operator, though they had to leave the explicit
indirection in the declaration. Personally, I prefer the older semantics
because it made the language more symmetrical and comprehensible (yes, the
extra indirection operator made the language clearer: some people don't
like the parens in lisp, but they sure make the syntax and semantics closer
than in (say) Logo).
-- 
Peter da Silva / 77487-5012 USA / +1 713 274 5180
true(<<VV$@\\$'&O 9$O%'$LT$&$"V6"$&$<4$?'&$ #I&&?$=$<<@)24 24 scale 3 21 moveto
{dup 36 eq{pop not}{dup 7 and 4 sub exch 56 and 8 div 4 sub 2 index{rlineto}{
rmoveto}ifelse}ifelse}forall stroke pop showpage % Har du kramat din varg idag?
Technical Details
Message-ID: <id.4W3V.ZPH@ferranti.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!ficc!peter
References: <mwm.2lit@contessa.palo-alto.ca.us> <id.SJYU.I62@ferranti.com> <mwm.2mx5@contessa.palo-alto.ca.us>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!ficc!peter
From: peter@ferranti.com (peter da silva)
Subject: Re: Pointers
Message-ID: <id.4W3V.ZPH@ferranti.com>
Organization: Xenix Support, FICC
References: <mwm.2lit@contessa.palo-alto.ca.us> <id.SJYU.I62@ferranti.com> <mwm.2mx5@contessa.palo-alto.ca.us>
Date: Thu, 19 Nov 1992 20:31:07 GMT
Lines: 43