(define the-procedure
(let-syntax((l(syntax-rules()((l((x(y ...))...)b ...)(let-syntax((x
(syntax-rules()y ...))...) b ...)))))(l('(('(a b ...)(lambda a b
...)))`((`(a b c)(if a b c))(`(a)(car a))),((,(a b)(set! a b))(,(a)(cdr
a))),@((,@z(call-with-current-continuation z))))'((ls)('((s)('((i)
('((d)('((j)('((c)('((p)('((l)('(()(l l))))'((k)`((pair?,(p))('((c)
,(p(append,(,(p))(d c)))(k k))(c`(p)`(,(p))c))`(p)))))(cons(d)(map d
ls))))'((x y c),@'((-)(s x y null? - s)(j x y c)))))'((x y
c)('((q)('((f)(cons`(q)(c((f x)x)((f y)y)c)))'((h)`((eq? q h)'((x),(x))
i)))),@'((-)(s x y'((z)(>=`(z)(sqrt(*`(x)`(y)))))- s))))))list))
'((z)z)))'((x y p k l),@'((-)`((p x)(k y)(l y x'((z)`((p z)-(- #f)))k
l)))))))))
Q1: Does it work under your favourite Scheme?
Q2: What does the procedure do?
The procedure is original work by me and I don't consider it neither a
good Scheme procedure nor an excellently obfuscated one.
Regards,
--
Antti Huima
> Q2: What does the procedure do?
>
> The procedure is original work by me and I don't consider it neither a
> good Scheme procedure nor an excellently obfuscated one.
>
You don't know what Your "original work" does, and hope someone else would
know?
Kawa does accept it.
> Q2: What does the procedure do?
It is obfuscated far beyond my limited ability to comprehend it (even when
pretty printed). The only input I can come up with that doesn't result in a
type error just returns the the parameter.
jim
----------------------------------------------------------------
James P. White Pagesmiths' home is http://www.pagesmiths.com
Live free http://www.ushistory.org/franklin/quotable/quote04.htm
Try Kawa, the Java-based Scheme http://www.gnu.org/software/kawa
I hope that this was a troll and that I thus provide you extra vibes
by answering it. The code was written by me.
--
Antti Huima
It produces error-messages by the scheme-interpreter...
...and we have to debug it...
> This works under Chez Scheme:
>
> ...
>
> Q1: Does it work under your favourite Scheme?
>
> Q2: What does the procedure do?
Answers:
A1: It should be R5RS-compliant.
A2: It is a procedure for sorting a list of non-negative reals:
(the-procedure '(5 1 3 9)) ==> (1 3 5 9)
--
Antti Huima
Well, yes, Kawa is "mostly" R5RS compliant.
> A2: It is a procedure for sorting a list of non-negative reals:
>
> (the-procedure '(5 1 3 9)) ==> (1 3 5 9)
Heh. Too funny. The only tests I did with lists of numbers happened to be
in sequence, so it appeared to me to simply return the list.
#|kawa:2|# (the-procedure '(9834 304 2373 1 23 3 2 32983 23 2 324))
(1 2 2 3 23 23 304 324 2373 9834 32983)
#|kawa:3|# (the-procedure '(9834 304 2373 1 23 3
98349384938498349839747473947938493483948934893843947478347090823982
2 32983 983498349834 423 2 9873498374983743 479398888798749384798
398479387498374893749834738488793847834 324))
(1 2 2 3 23 304 324 423 2373 9834 32983 983498349834 9873498374983743
479398888798749384798 398479387498374893749834738488793847834
98349384938498349839747473947938493483948934893843947478347090823982)
> Answers:
>
> A1: It should be R5RS-compliant.
Unlike for Jim White, Kawa did not accept the code for me.
Unbound symbol pair?,
According to R5RS 7.7.1, a comma is not a delimiter, so Kawa is within
its rights to lex it as a single token. Of course, since a comma is not
a standard identifier character, Chez Scheme is within its rights to lex
it as it does.
Fixing that, I got similar errors with commas, ticks and backticks.
> A2: It is a procedure for sorting a list of non-negative reals:
>
> (the-procedure '(5 1 3 9)) ==> (1 3 5 9)
Once spaces had been inserted at appropriate points, Kawa did run the
procedure correctly. I didn't try it in Kawa when I first saw
call/cc. I assumed that obfuscated Scheme code would use captured
continuations. Kawa only partially supports continuations, but that was
enough for this example.
--
(for-each (lambda (str) (display (string-append (make-string (- 40
(quotient (string-length str) 2)) #\space) str)) (newline)) '(""
"Bruce Lewis" "MIT 1990" " http://brl.sourceforge.net/
")) ; I rarely read mail sent to brl...@yahoo.com
> This works under Chez Scheme:
Works fine out-of-the-box in DrScheme, too.
Seems to sort lists of numbers in increasing order, in some wacky way.
Shriram