Groups | Search | Server Info | Login | Register


Groups > comp.programming.contests > #17

Re: The First Pure Shell Contest (PUSH): relativepath

From Jens Schweikhardt <usenet@schweikhardt.net>
Newsgroups comp.unix.shell, comp.unix.programmer, comp.programming.contests
Subject Re: The First Pure Shell Contest (PUSH): relativepath
Date 2011-08-19 21:08 +0000
Message-ID <9b81m8FiseU5@mid.individual.net> (permalink)
References (3 earlier) <j2mcs5$25i$1@speranza.aioe.org> <9b7rsrFiseU3@mid.individual.net> <j2me7e$5r5$1@speranza.aioe.org> <9b7tv0FiseU4@mid.individual.net> <j2mh0g$cps$1@speranza.aioe.org>

Cross-posted to 3 groups.

Show all headers | View raw


In comp.unix.shell pk <pk@pk.invalid> wrote:
# On 19 Aug 2011 20:04:48 GMT, Jens Schweikhardt <usenet@schweikhardt.net>
# wrote:
# 
#> Still, I don't see where your rules forbid using Perl or Awk if one's
#> POSIX shell has them built-in (which was the OP's question).
#> 
#> It forbidden by the well known standardese rule of "if it's not defined,
#> then it's undefined." aka "undefined by omission".
# 
# Is it well known?
# 
#>       3 You can assume that 'test' and '[' are built-ins. If this is not
#> true for your shell you may set PATH with env -i PATH=... to the
#>         directory with the 'test' and '[' executables for the sole
#> purpose of using these external commands. It must run without PATH on a
#> shell where these are built-ins (i.e. on the contest evaluation machine).
#> 
#> perl isn't mentioned. So you can not assume it is a built-in.
# 
# Uh...this is basic logic. If I say "you can use the bicycle", does it follow
# that you are not allowed to use the car?

If that sentence appeared in an ISO document, I'd say yes. If I told you
"You can use my bicycle" and you took my car, I'd be surprised.
Standardese logic is somewhat different. When you tell your sweatheart
"I love you" that usually *does* exlude loving the other heartbreakers
in town, without you appending "and only you". Even everyday logic has
this property and it's not too unusual to apply this kind of reasoning.

# If you said "you can assume that only 'test' and '[' are built-in", then
# things would have been different.

Even better would have been "As the only additional builtins to those
explicitly enumerated in the POSIX shell you can assume test, [ and
printf." I'll keep that in mind for the next PUSH.

#> I believe that the name of the contest gives an oh so slight hint that a
#> solution involving perl is not quite what is meant. The motivation
#> paragraph too (even mentions awk). If that isn't enough, the contestant
#> would surely wonder if perl was also a built-in on the unknown contest
#> evaluation machine.
# 
# Admittedly the Perl and awk example was a stretch, but surely there are a
# number of commands that are on the border, and a contestant may assume in
# good faith that he's legitimate to use some of them, only to have his
# submission fail on your machine. So I think you should explicitly list what
# built-ins are available in the evaluation machine's shell, so people know
# what they can rely on.

I thought this was clear from providing the link in the sample entry.
But the "Not exhaustive!" note could be read as opening a wide hole.
MISREAD in my mind.

#> Reading a text, understanding it and inferring a writer's intention are
#> the initial barriers to participating in the contest. I think this goes
#> for most contests.
# 
# The same goes for the OP's first comment (and if you've been reading
# these groups for a while, I'm sure you know that he knows what he's talking
# about). The intention, to me, was to signal that some parts of the rules
# were not clear, and instead you interpreted it as a nitpick. See? It works
# both ways.

Yes, I know Stéphane is a shell wizard but I am still puzzled why he
replied the way he did. I assume it is because he wants to point out
where the test leaves too much room for misinterpretation, just like he
would point out conditions under which a shell script would not do what
it is supposed to do--which is a good thing, which I appreciate.
I'm no stubborn bonehead and neither are you or Stéphane :-)

#> I admit there is room for improvement regarding its formal "rules" (heck,
#> the very word does not even appear once!), but I did not want to overload
#> the text with kilobytes of blah blah just to fend off the nit-pickers,
#> who would find a hole in any formal set of rules. One thing I really
#> should add for the next PUSH is "Rule interpretation is MINE ALONE.
#> PERIOD!" :-)
# 
# Even then, you should make that interpretation explicit (that is, write it),
# and not assume that people can somehow magically infer it.

Fair enough. Now that all is clear as mud, back to hacking relativepath :-)

Regards,

	Jens
-- 
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)

Back to comp.programming.contests | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

The First Pure Shell Contest (PUSH): relativepath Jens Schweikhardt <schweikh@schweikhardt.net> - 2011-08-19 17:23 +0000
  Re: The First Pure Shell Contest (PUSH): relativepath Stephane CHAZELAS <stephane_chazelas@yahoo.fr> - 2011-08-19 18:13 +0000
    Re: The First Pure Shell Contest (PUSH): relativepath Jens Schweikhardt <usenet@schweikhardt.net> - 2011-08-19 19:12 +0000
      Re: The First Pure Shell Contest (PUSH): relativepath pk <pk@pk.invalid> - 2011-08-19 21:14 +0200
        Re: The First Pure Shell Contest (PUSH): relativepath Jens Schweikhardt <usenet@schweikhardt.net> - 2011-08-19 19:29 +0000
          Re: The First Pure Shell Contest (PUSH): relativepath pk <pk@pk.invalid> - 2011-08-19 21:37 +0200
            Re: The First Pure Shell Contest (PUSH): relativepath Jens Schweikhardt <usenet@schweikhardt.net> - 2011-08-19 20:04 +0000
              Re: The First Pure Shell Contest (PUSH): relativepath pk <pk@pk.invalid> - 2011-08-19 22:25 +0200
                Re: The First Pure Shell Contest (PUSH): relativepath Jens Schweikhardt <usenet@schweikhardt.net> - 2011-08-19 21:08 +0000
  Re: The First Pure Shell Contest (PUSH): relativepath Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-08-19 19:58 +0100
    Re: The First Pure Shell Contest (PUSH): relativepath Jens Schweikhardt <usenet@schweikhardt.net> - 2011-08-19 19:23 +0000
      Re: The First Pure Shell Contest (PUSH): relativepath Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-08-19 22:18 +0100
  Re: The First Pure Shell Contest (PUSH): relativepath Stephane CHAZELAS <Stephane.CHAZELAS@free.fr> - 2011-08-20 20:07 +0000
    Re: The First Pure Shell Contest (PUSH): relativepath Jens Schweikhardt <usenet@schweikhardt.net> - 2011-08-21 10:43 +0000
    Re: The First Pure Shell Contest (PUSH): relativepath Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-08-21 15:14 +0100
      Re: The First Pure Shell Contest (PUSH): relativepath Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-08-21 18:28 +0300
      Re: The First Pure Shell Contest (PUSH): relativepath Stephane CHAZELAS <stephane_chazelas@yahoo.fr> - 2011-08-21 16:19 +0000
        Re: The First Pure Shell Contest (PUSH): relativepath Stephane CHAZELAS <stephane_chazelas@yahoo.fr> - 2011-08-21 20:12 +0000
  Re: The First Pure Shell Contest (PUSH): relativepath Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-08-22 21:15 +0100
    Re: The First Pure Shell Contest (PUSH): relativepath Stephane CHAZELAS <stephane_chazelas@yahoo.fr> - 2011-08-23 18:23 +0000
      Re: The First Pure Shell Contest (PUSH): relativepath Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-08-23 19:52 +0100
        Re: The First Pure Shell Contest (PUSH): relativepath Stephane CHAZELAS <stephane_chazelas@yahoo.fr> - 2011-08-23 21:56 +0000

csiph-web