Better HN
topnewbestaskshowjobs
Log inSign up

n0thing2kn0

1 karma · joined Jul 22, 2011 (15y ago) · 2 submissions

Submissions

comment 14y ago · link · parent

To play devils advocate here... This specific example could be solved with implicit returns in Coffeescript:

    class FileInfo

      constructor: (@name)->

      mtime: ->
        #implicit return
        @withFile (f)->
          if f.time isnt 999 then "too old"

      withFile: (block)->
        try
          block
            name: @name
            time: 1000
        finally
          console.log 'finished'

    f = new FileInfo('name')
    console.log f.mtime()
#finished

#too old

2.

Alice: A Lightweight Independent CSS Engine(blackberry.github.com ↗)

2 points · by n0thing2kn0 · 15y ago · discuss