[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [school-discuss] oh no, not serpentarium



On Wed, Apr 16, 2008 at 09:00:19AM +1000, Richard Andrews wrote:
> > >>> "Hello World"
> > 'Hello World'
> > See the quotes change... bet it's a consequence of yet another kluge.
> Python has a standard output mechanism.

So we just named the same thing from a bit different perspective.
There's nothing wrong with that probably, I happen to have
similar issues with MS folks quite frequently ("it's not a kluge,
it's a feature!") and already got used to.

> It allows "Hello World" or 'Hello World' as input and will
> generate output which is suitable for input. Python allows 
> "I'm hungry" so you don't have to escape single quotes.

Welcome to MzScheme v372 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
> "I'm hungry"
"I'm hungry"

BTW shell allows that too.  No cookie.

It's harder with a single quote in Lisp-likes due to 'smth being
a shortcut for (quote smth) special form :)  One has to either
quote or construct a string then:

> (display "\"\"")
""> 

> (display "'I said \"Hi\"'")
'I said "Hi"'>

> It allows 'I said "Hi"', so you don't have to escape double
> quotes and it allows '''I said "Hi, I'm hungry"''' so you can
> have both (allows newlines BTW).

Would get *transformed* to 'I said "Hi, I\'m hungry"' BTW.

Not touching the whitespace topic at all, I'd only state that
so far I'm way more comfortable with orthogonal data presentation
formats which would enable output equal to the input as long as
reasonable.  s-expressions come as close to that as I've seen.

And inobvious python stuff like this is probably not what you
really want to explain to curious children (I bet those who did
lessons with kids going to olympiads do understand how unexpected
and interesting their innocent questions are at times):

x = [0,1]; y = x; y[0] = 2; print x

Messy, eh?  I understand it's "yet another standard mechanism"
but am fed up with stuff like that and definitely don't want
to feed children with it.

> > Python is a bit less boring stuff than Java, still I'm yet to
> > see a seasoned developer who would recommend python as a
> > first programming language.
> I did. I guess you missed that.

Sure, but then again I'm yet to see you *at least* :)

-- 
 ---- WBR, Michael Shigorin <mike@xxxxxxxxxxx>
  ------ Linux.Kiev http://www.linux.kiev.ua/