Re: which one do you prefer? python with C# or java?

2012-06-10 Thread Harald Hanche-Olsen
[becky_lewis ]

> Lisp and Clojure are functional languages.

No, they're not.

But you can (and often will) do quite a bit of functional programming in
Lisp, as it lends itself quite naturally to that way of thinking.

But in (Common) Lisp you also have CLOS, which is a rather different way
to do object oriented programming. It will widen your horizon in more
than one way.

The advice to learn just one programming language at a time seems sound,
though. I would take it, if I were you.

-- 
* Harald Hanche-Olsen http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell
-- 
http://mail.python.org/mailman/listinfo/python-list


Whither datetime.date ?

2005-02-26 Thread Harald Hanche-Olsen
I'm confused.  I was going to try linkchecker, and it dies with a
traceback ending in

  File "/usr/local/lib/python2.4/calendar.py", line 32, in _localized_month
_months = [datetime.date(2001, i+1, 1).strftime for i in range(12)]
AttributeError: 'module' object has no attribute 'date'

Sure enough, there is no datetime.date, but there is a datetime.Date:

Python 2.4 (#2, Feb 19 2005, 20:35:23)
[GCC 3.4.2 [FreeBSD] 20040728] on freebsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> dir(datetime)
['Date', 'DateTime', ...]

However, the Library Reference clearly states that datetime.date
should exist.  Granted, it's been a while since I used python in
anger, but isn't this what it says?

  http://www.python.org/doc/2.4/lib/node243.html
  http://www.python.org/doc/2.4/lib/datetime-date.html

Moreover, the datetime.date class is supposed to have a strftime()
method.  datetime.Date does not.

I'm beginning to wonder if the FreeBSD python package is at fault.

Or what is really going on here?

-- 
* Harald Hanche-Olsen http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
  than thinking does: but it deprives us of whatever chance there is
  of getting closer to the truth.  -- C.P. Snow
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Whither datetime.date ?

2005-02-26 Thread Harald Hanche-Olsen
+ Tim Peters <[EMAIL PROTECTED]>:

| As you've deduced, you're certainly not getting Python's builtin
| datetime module.

Argh.  Yeah, I've had one lying around in my personal python directory
since 2000, had totally forgotten it was there.  This one ...

*** Author: Jeff Kunce <[EMAIL PROTECTED]>
*** Download from: http://starship.skyport.net/crew/jjkunce

Removed it, now all is well.

Thanks for pointing out the blindingly obvious.

-- 
* Harald Hanche-Olsen http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
  than thinking does: but it deprives us of whatever chance there is
  of getting closer to the truth.  -- C.P. Snow
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Harald Hanche-Olsen
[Icarus Sparry ]

> The 'modern' way to do this is
> find . -maxdepth 2 -name '*.html' -exec grep whatever {} +

Actually, I think it should be

find . -maxdepth 2 -name '*.html' -exec grep whatever /dev/null {} +

because grep behaves differently when given only one filename as opposed
to several.

-- 
* Harald Hanche-Olsen http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Harald Hanche-Olsen
[Icarus Sparry ]

> The 'modern' way to do this is
> find . -maxdepth 2 -name '*.html' -exec grep whatever {} +

Actually, I think it should be

find . -maxdepth 2 -name '*.html' -exec grep whatever /dev/null {} + \;

because grep behaves differently when given only one filename as opposed
to several.

-- 
* Harald Hanche-Olsen http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell
-- 
http://mail.python.org/mailman/listinfo/python-list