# OSCON 2008: Day One


By Ben Ramsey

Published on July 22, 2008


I find myself once again in Portland, OR at the [O'Reilly Open Source Convention](http://www.oscon.com/oscon2008). This year, I'm giving a talk on [memcached](http://en.wikipedia.org/wiki/Memcached). The talk is on the PHP track, but the concepts can apply in any of the other languages represented at OSCON, so if you're interested in memcached and how to use it, [stop by on Wednesday at 5:20pm](http://www.oscon.com/oscon2008/public/schedule/detail/2751).

In previous years at OSCON, I've stuck mainly to the PHP track. This is because I have a lot of friends who are speakers, and so I've attended their talks to learn from and support them. This year, though, I've decided to focus on some of the other languages represented here, particularly Python and Erlang. This morning, for example, I attended Steve Holden's [Python In 3 Hours](http://www.oscon.com/oscon2008/public/schedule/detail/2488) tutorial. Tomorrow, I'll be attending the [Practical Erlang Programming](http://www.oscon.com/oscon2008/public/schedule/detail/3373) tutorial, and later this week, I'll get [Just Enough C for Open Source Projects](http://www.oscon.com/oscon2008/public/schedule/detail/3050).

So, today, one of the more interesting features I learned that Python supports is the concept of [closures](http://en.wikipedia.org/wiki/Closure_(computer_programming)). Here's a simple example from the tutorial:

```python
# Closures example

def adder(n):
  def add(m):
    return m+n
  return add

add20 = adder(20)

print add20(2) # should print 22

l = []
for i in range(100):
  l.append(adder(i))

print l[13](22) # should print 35
```

FYI: There's been some [discussion](http://web.archive.org/web/20080623025619/http://aspn.activestate.com/ASPN/Mail/Message/php-dev/3640369) surrounding a recent [patch proposal to add closures and lambda functions to PHP](https://wiki.php.net/rfc/closures).

At any rate, it's good to be back at OSCON this year, catching up with old friends, making new friends, and expanding my knowledge of open source languages.

By the way, I've brought along with me 10 [elePHPants](https://www.flickr.com/groups/elephpants/pool/) who need good homes. If you want one, it's yours. You just have to find me in person and let me know. They're first-come, first-serve.


