Description:
The Scheme Programming language.
|
|
|
ssax-sxml to ignore namespaces
|
| |
I'm using ssax-sxlm to parse Maven's pom.xml files. Some will have namespaces and the rest just a plain project tag. I'd like to get the sxml with the simple local names even when the namespaces are present but haven't figured out how to use ssax-sxml for doing that.
Alternatively, I defined two aliases, for ns and xsi, but can't get the sxpath function to recognize the aliases (I get "unknown namespace ns") using a string path like "//project/dependencies/*".... more »
|
|
SICP: Exercise 1.11.
|
| |
Hello,
I've got stuck with another exercise.
"A function f is defined by the rule that f(n) = n if n<3 and f(n) =
f(n - 1) + 2f(n - 2) + 3f(n - 3) if n> 3. Write a procedure that
computes f by means of a recursive process. Write a procedure that
computes f by means of an iterative process." [1]... more »
|
|
SICP: Counting change
|
| |
Hello,
"If a is exactly 0, we should count that as 1 way to make change." [1]
Could you explain this? I thought that we should count that as 0 ways
to make a change.
[1] [link]
Regards
|
|
in search of a cute type predicate syntax
|
| |
Ciao,
I am redesigning the class libraries in Nausicaa[1]; one goal
is to allow use of classes and labels by importing only the type
identifier (which is a macro keyword) and not the full language
(nausicaa). For example:
#!r6rs
(library (alpha)
(export <alpha>)
(import (nausicaa))... more »
|
|
Why is (eqv? g g) unspecified in R6RS when g is a procedure?
|
| |
One of the changes between R5RS and R6RS is that (eqv? x x), where
x is a variable whose value is a procedure, is allowed to return #f.
The R6RS Rationale, section 11.5.1, says in its entirety:
The definition of eqv? allows implementations latitude in their
treatment of procedures: implementations are free either to detect or... more »
|
|
Faster remove-duplicates with sorted list.
|
| |
...
...
Using Racket instead of COBOL:
(define (remove-duplicates-sorted xs [prev xs]) (define (test x) (begin0 (equal? x prev) (set! prev x)))
(filter-not test xs))
(remove-duplicates-sorted '(a a b c c c d d))
=> '(a b c d)
Always remember, and never forget:
WE DON'T NEED NO STINKIN' LOOPS!... more »
|
|
|