Why there is not restart exception handling in PLT Scheme

YC asked here[1]:

Is it possible to handle exceptions like Common Lisp, specifically restarts?
Scenario: undefined variables – handling by defining the variable, and continue past the exception.

Matthew explained what is and is not possible in the following threads here, here, and here.
[1]: PLT Scheme Mailing list, “restart exception handling?”, Thu Jul 10 17:35:57 EDT 2008

Hacking PLT to add a range syntax

Here is a post demonstrating how to add an infix range syntax to PLT Scheme.

[a .. b]  => (interval a b)
(... expr1 [expr2] ...) => (... (vector-ref expr1 expr2) ...)

Addendum: 04/20/09
Here is the final version of the code, with additional interesting syntax:

That includes:
[1 .. 4] short interval (1 to 3)
[1 … 4] long interval (1 to 4)
Curry with {}:
{+ _ 3} => (lambda (x) (+ x 3)
{+ _ (* 2 _)} => (lambda (x y) (+ x (* 2 y)))
This is convenient with map and filter:
(map {+ _ 3} [1 … 3]) => ‘(4 5 6)
Iota from SRFI 1:
[5] => (iota 5) => (0 1 2 3 4)
[5 3] => (iota 5 3) => (3 4 5 6 7)
[5 3 2] => (iota 5 3 2) => (3 5 7 9 11)
Lambdas:
{n -> (+ n 1)} is (lambda (n) (+ n 1)
And a very simple comprehension:
> [(+ n 3) : n is (< n 10) (even? n)] (3 5 7 9 11) > [(+ n 3) : n is (< n 10)] (3 4 5 6 7 8 9 10 11 12) > [(* n n) : n is (< n 10) (odd? n)] (1 9 25 49 81)

The PLT email list archive URLs have changed

The PLT Scheme email list archive URLs have changed. You can read all about it in this thread.
The result is that any links posted before this change was made are now broken.
Basically it is no one’s fault: not the PLT folks nor the sysadmins. The mailing list software reindexes messages in this breaking manner.
Nonetheless, now there are around 200 broken links on this site alone. I’m neither sure how to fix them automatically nor manually. Clearly the latter would be too time consuming.

Rudyard Kipling's If

Found here:

If you can keep your head when all about you
Are losing theirs and blaming it on you;
If you can trust yourself when all men doubt you,
But make allowance for their doubting too;
If you can wait and not be tired by waiting,
Or, being lied about, don’t deal in lies,
Or, being hated, don’t give way to hating,
And yet don’t look too good, nor talk too wise;
If you can dream – and not make dreams your master;
If you can think – and not make thoughts your aim;
If you can meet with triumph and disaster
And treat those two imposters just the same;
If you can bear to hear the truth you’ve spoken
Twisted by knaves to make a trap for fools,
Or watch the things you gave your life to broken,
And stoop and build ’em up with wornout tools;
If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
And never breath a word about your loss;
If you can force your heart and nerve and sinew
To serve your turn long after they are gone,
And so hold on when there is nothing in you
Except the Will which says to them: “Hold on”;
If you can talk with crowds and keep your virtue,
Or walk with kings – nor lose the common touch;
If neither foes nor loving friends can hurt you;
If all men count with you, but none too much;
If you can fill the unforgiving minute
With sixty seconds’ worth of distance run –
Yours is the Earth and everything that’s in it,
And – which is more – you’ll be a Man my son!

(via Bruce)

Be relentlessly resourceful

I was writing a talk for investors, and I had to explain what to look for in founders. What would someone who was the opposite of hapless be like? They’d be relentlessly resourceful. Not merely relentless. That’s not enough to make things go your way except in a few mostly uninteresting domains. In any interesting domain, the difficulties will be novel. Which means you can’t simply plow through them, because you don’t know initially how hard they are; you don’t know whether you’re about to plow through a block of foam or granite. So you have to be resourceful. You have to have keep trying new things.
Be relentlessly resourceful.

–Paul Graham
(via Ben)

What file is a name defined in?

 

#lang scheme
; What file is a name defined in?
;; definition-source : identifier -> (U symbol path)
;; Returns a symbol or path for the module that contains
;; the definition for a given name.
(define (definition-source id)
  (let ([binding (identifier-binding id)])
    (and (list? binding)
         (resolved-module-path-name
          (module-path-index-resolve (car binding))))))
(definition-source #'map)
 ; => #
(definition-source #'+)
; => #%kernel
; "The + procedure is defined in the built-in kernel module
; (it has no Scheme source file)."

(via PLT)

Simple Yearly Archive

Simple Yearly Archive is a rather neat and simple WordPress plugin that allows you to display your archives in a year-based list. It works mostly like the usual WP archive, but displays all published posts seperated by their year of publication. That said, it’s also possible to restrict the output to certain categories, and much more.

The default WordPress “Archive” widget is nice, but once you get more than a couple years worth of archives it starts to take up a lot of space and as such become very ugly. This plugin deals with the problem rather nicely by allowing you to include the archive anywhere you wish. For example, I put it on a page (aptly) named “Archive”.
The one thing that you will probably want to do right off the bat is to configure a date-format for the posts and display post-count per year.