On 03/03/2008, Alaric Snell-Pym <[EMAIL PROTECTED]> wrote:
> On 3 Mar 2008, at 12:33 pm, Tobia Conforto wrote:
> Here is a typical Unlambda program:
> `r```.H.e.l.l.o. .w.o.r.l.di
Typical because it's very nearly the only one commonly seen? :)
> > A shortest code programming contest,
On 3 Mar 2008, at 12:33 pm, Tobia Conforto wrote:
LOL at the S combinator, the most obscure invention of computer
science (or was it lambda calculus?) to date. I've never fully
understood it.
Ah, that's easy...
The idea of combinators, as I understand it, is that you can get rid
of lambdas
Alaric Snell-Pym wrote:
it'd be too easy: Start by (set! ...)ing a load of common globals
to other things in an ever-shifting sea of misleading bindings,
define a macro called + that implements the S combinator in some
bizarre way, bind "quote" to a function so "'a" means something
quite
On 3 Mar 2008, at 12:11 am, Tobia Conforto wrote:
PS: we need an Obfuscated Scheme Contest
No!!
Anyway, it'd be too easy: Start by (set! ...)ing a load of common
globals to other things in an ever-shifting sea of misleading
bindings, define a macro called + that implements the
Apologies, I think I misread the thread.
Anyways:
Elf wrote:
how is it that ('a ...) isn't a syntax error? Is it because 'a
expands to (quote a), and is thus treated by case as a list of the
symbols quote and a? And if so, is that correct behavior? After all,
csi> (pair? 'a)
#f
(as I expect
Elf wrote:
(define foo 'quote)
(case foo
('a 1)
(else 2)) => 1
the proper behaviour in this case, btw, has not yet been given.
This *is* the proper behaviour, although it could qualify for an
"Obfuscated Scheme" contest.
You see, case is a macro. It parses its body with its own rules.
On Sat, Mar 1, 2008 at 7:40 PM, Elf <[EMAIL PROTECTED]> wrote:
>
> id consider it a bug with the reader fighting with the macroexpander for
> unpredictable dominance of the universe.
Just to be clear, elf -- what specifically is the bug that you see
here? Do you really see unpredictability, or j
id consider it a bug with the reader fighting with the macroexpander for
unpredictable dominance of the universe.
-elf
On Thu, 28 Feb 2008, Ivan Raikov wrote:
Well, R5RS does not specify what happens in the second case, so you
can consider it a feature :-)
Matt Gushee <[EMAIL PROTECT
no, actually, i get lots of errors about 'quote' being an invalid
value to car in macros.
to demonstrate:
(define foo 'quote)
(case foo
('a 1)
(else 2)) => 1
the proper behaviour in this case, btw, has not yet been given.
(define foo 'a)
(case foo
((a) 1)
(else 2))
is the
Shawn W. wrote:
On Feb 27, 2008, at 6:39 PM, Matt Gushee wrote:
I have just written a 'string-case' macro--it is supposed to behave
just like case, except that it uses string=? in place of eqv? as its
equality predicate.
Insert obligatory plug for my extended-cond egg, which has a version
On Feb 27, 2008, at 6:39 PM, Matt Gushee wrote:
Hi, all--
I have just written a 'string-case' macro--it is supposed to behave
just like case, except that it uses string=? in place of eqv? as
its equality predicate.
Insert obligatory plug for my extended-cond egg, which has a version
of
On Wed, Feb 27, 2008 at 08:04:23PM -0700, Matt Gushee wrote:
> Wait a minute, though. I understand now why
>
>(('a) ...)
>
> didn't match, but how is it that
>
>('a ...)
>
> isn't a syntax error? Is it because 'a expands to (quote a), and is thus
> treated by case as a list of the symb
Well, R5RS does not specify what happens in the second case, so you
can consider it a feature :-)
Matt Gushee <[EMAIL PROTECTED]> writes:
>
> Wait a minute, though. I understand now why
>
> (('a) ...)
>
> didn't match, but how is it that
>
> ('a ...)
>
> isn't a syntax error? Is it beca
Matt Gushee wrote:
isn't a syntax error? Is it because 'a expands to (quote a), and is thus
treated by case as a list of the symbols quote and a? And if so, is that
correct behavior? After all,
csi> (pair? 'a)
#f
(as I expected).
[with apologies for replying to myself]
Oh, wait:
csi> (pa
Ivan Raikov wrote:
Remember that in Scheme, (define foo 'a) is a shortcut for
(define (define foo (quote a))) -- quote is a special form, and not
a part of the literal. So you in your case statement you are not
matching the symbol a, you are actually matching the symbol 'a (the
apostrophe is
Yes. My apologies for screwing up something so simple to correct a
simple mistake :-)
Here is the relevant part of R5RS:
Literal expressions
---
- syntax: quote
- syntax: '
- syntax:
`(quote )' evaluates to . may be any
external representation of a Scheme o
Ivan Raikov wrote:
Oops, I meant that (define foo 'a) -> (define foo (quote a)).
No wonder I was confused.
--
Matt Gushee
: Bantam - lightweight file manager : matt.gushee.net/software/bantam/ :
: RASCL's A Simple Configuration Language : matt.gushee.net/rascl/ :
__
Ivan Raikov wrote:
Remember that in Scheme, (define foo 'a) is a shortcut for
(define (define foo (quote a)))
Well, I can't remember that because I never learned it! And I'm not sure
I understand it now ... have to ponder a bit.
-- quote is a special form, and not
a part of the literal.
On 28/02/2008, Ivan Raikov <[EMAIL PROTECTED]> wrote:
>
> Oops, I meant that (define foo 'a) -> (define foo (quote a)).
Right, that had my head in an "I want some of whatever he's smoking"
kinda loop...
Leo
___
Chicken-users mailing list
Chicken-use
Oops, I meant that (define foo 'a) -> (define foo (quote a)).
-Ivan
Ivan Raikov <[EMAIL PROTECTED]> writes:
> Remember that in Scheme, (define foo 'a) is a shortcut for
> (define (define foo (quote a))) -- quote is a special form, and not
> a part of the literal. So you in your case st
Remember that in Scheme, (define foo 'a) is a shortcut for
(define (define foo (quote a))) -- quote is a special form, and not
a part of the literal. So you in your case statement you are not
matching the symbol a, you are actually matching the symbol 'a (the
apostrophe is treated as a literal
Hi, all--
I have just written a 'string-case' macro--it is supposed to behave just
like case, except that it uses string=? in place of eqv? as its equality
predicate. But in the course of writing test cases, I have encountered a
surprise: the Chicken version of case appears to be non-compliant
22 matches
Mail list logo