🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2596

Re: Common way to obfuscate?

#2596
From: Nick Maclaren
Date: Mon, 15 Apr 1996 18:08
26 lines
1525 bytes
In article <4khp20$pt@solutions.solon.com>, tim@franck.Princeton.EDU (Tim Hollebeek) writes:
|> Marcel van Kervinck (buex95a@urc.tue.nl) wrote:
|> : I just recovered from a slight shock caused by realizing that
|> : one could legally rewrite 'a[b[c]]' as 'c[b][a]'
|> 
|> Right, since they are both *(a + *(b + c)).  Cute.

This is one of the bizarrer aspects of C's history.  The equivalence
comes from BCPL which, being typeless, a[b] and b[a] (actually a!b
and b!a) were naturally the same.  I have no idea how it survived the
language changes from BCPL to B and then C!

|> : Is this a common way to obfuscate code?
|> 
|> Wouldn't know.  I strive to write clear code :-)

In BCPL, it was quite clear.  I believe that its only use in C is
deliberately to obfuscate code, and I have never seen it used even
in the worst macroid programs.


Nick Maclaren,
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Email:  nmm1@cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679
Technical Details
Message-ID: <4ku3av$4v5@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4khlas$t2g@solutions.solon.com> <4khp20$pt@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.lang.c.moderated
Subject: Re: Common way to obfuscate?
Date: 15 Apr 1996 13:08:31 -0500
Organization: University of Cambridge, England
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4ku3av$4v5@solutions.solon.com>
References: <4khlas$t2g@solutions.solon.com> <4khp20$pt@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com