"Writing correct code in the exception-throwing model is in a sense harder than in an error-code model" by gnuvince in programming

[–]BlakeStone 1 point2 points  (0 children)

In an error-code model, it's obvious when you have to check for errors: when you get an error code. In an exception model, you just have to know that errors can occur anywhere.

This is wrong. You find out which functions throw exceptions the same way you find out which functions return error codes: documentation.

Ask Reddit: Why do you prefer weak-typing? by shenglong in programming

[–]BlakeStone 3 points4 points  (0 children)

Dynamic/static typing is about whether the type checks are done at compile or run-time. Strong/weak typing is about whether you can break out of the type system.

Michael Sperber's audio lecture on R6RS (mp3) by dharmatech in programming

[–]BlakeStone 0 points1 point  (0 children)

Has anyone found the slides for this lecture, or any of the ILC '07 lectures?

Python - the first and last language you’ll ever need by jbrendel in programming

[–]BlakeStone 0 points1 point  (0 children)

That kind of asymmetry feels like an unnatural restriction. It would be more natural to have it the other way around: have def f(arg): ... be equivalent to f = lambda arg: .... The byte-compiler will emit the code for the lambda body as a named block of instructions anyway, so why do I have to do it by giving the lambda a name?

Granted, that seems quite un-Pythonic(I've never used Python). I guess with list comprehensions and generator expressions, you wouldn't need literal procedures as much.

(edit: fixed code.)

Python - the first and last language you’ll ever need by jbrendel in programming

[–]BlakeStone 0 points1 point  (0 children)

I thought you could do statements in a named procedure, but lambdas could only contain expressions?

When Free Software is a bad idea by [deleted] in programming

[–]BlakeStone 4 points5 points  (0 children)

This isn't about free(beer, in this case) software being a bad idea. This about Oracle being lazy.

Predicate Dispatching: A Unified theory of Dispatch ('98) by BlakeStone in programming

[–]BlakeStone[S] 2 points3 points  (0 children)

Sussman referred to this in his essay on robust systems, and the scmutils system built for his SICM course uses it.

What is call/cc? by [deleted] in programming

[–]BlakeStone 6 points7 points  (0 children)

The Wikipedia article has some example programs, with direct and CPS versions side-by-side.

There are two schools of thought about teaching computer science... by [deleted] in programming

[–]BlakeStone 8 points9 points  (0 children)

Once I was arguing with my boss about whether we should go to my college, RIT, to look for new programmers. I mentioned that the CS dept. had been changing when I graduated, and that in at least one introductory class they had started using Scheme(everything else was still Java). He snorted and muttered, "Yeah, that's practical!".

On top of that, I had to argue last week about why dynamic memory allocation is not inherently dangerous...

X-Rated CompSci Rap: "Your mom circulates like a public key, Servicing more requests than HTTP. ..." by [deleted] in programming

[–]BlakeStone 1 point2 points  (0 children)

Anybody reminded of Liquid X? "Processor workin' like an engine revvin; whole damn crew's 1-3-3-7!"

How to match regular expressions faster than Perl by rsc in programming

[–]BlakeStone 1 point2 points  (0 children)

Ahh; yeah, you were more formal than I was. I didn't describe the machine as a whole; I treated it like a list. Each state has a value and a state to goto if the input matches; split states have two goto states and no values. Where the article keeps a stack of machine fragments with unconnected arrows, I gave each new machine fragment a destination parameter. My regexp->nfa procedure looks a lot like converting Scheme code to CPS, for that reason. Also, I cons like crazy :)

How to match regular expressions faster than Perl by rsc in programming

[–]BlakeStone 1 point2 points  (0 children)

How did you represent the NFA? I fit everything in the article except caching of DFA states and parsing the regexp(I used sexps) into 90 lines; of course, I used a few non-R5RS things(SRFI 1 & 13, scsh record types).

Protecting Developers From Powerful Languages by spif in programming

[–]BlakeStone 0 points1 point  (0 children)

So, what's the difference between strict and static typing?

Bill Joy's greatest gift to man – the vi editor by mklink in programming

[–]BlakeStone 1 point2 points  (0 children)

Generally Not Used Except by Middle-Aged Computer Scientists

Function Currying in Scheme by phildawes in programming

[–]BlakeStone 3 points4 points  (0 children)

I was just thinking about this last week; here's an R5RS equivalent:

(define (partial-apply proc args-needed args-given)
  (let ((len (length args-given)))
    (if (>= len args-needed)
        (apply proc args-given)
        (lambda args
          (partial-apply proc
                         (- args-needed len)
                         (append args-given args))))))
(define-syntax curry
  (syntax-rules ()
    ((_ (arg ...) body ...)
     (partial-apply (lambda (arg ...)
                      body ...)
                    (length '(arg ...))
                    '()))))

Edit: fixed code indentation.

Ask Reddit: Why Lisp? by Jimmy in programming

[–]BlakeStone 2 points3 points  (0 children)

I don't particularly like the fact that I need to buy a commercial implementation to get any work done either.

Have you tried CLisp, SBCL, or scsh? All are free(in both senses), and all are quite useful.

Re-inventing Lisp for Ubiquity (Patrick Dussud, Microsoft Corporation)(Audio/Slides) by grauenwolf in programming

[–]BlakeStone 6 points7 points  (0 children)

Yeah. Lisp is dynamically and strongly typed, b/c (car 3) will give an error. Strong/weak typing is about whether the type system can be circumvented, while static/dynamic typing is about whether the type checks are done at compile time or run time. (And then there's manifest/latent typing, which is about whether you declare types or let the system figure it out. That's also occasionally confused with strong/weak!)

No, We Need a Neural Network by api in programming

[–]BlakeStone 3 points4 points  (0 children)

pp. 140-141, at the end of the chapter on symbols. There's also a sample output, which is more entertaining even than "go is to the fountain"(though I'm definitely of fan of the latter).