On Saturday, January 12, 2019 8:34:35 PM PST Hassan Shahin wrote:
> I have this definition for a procedure:
>
> (define type-of (lambda (item)
> (cond
>[(pair? item) 'pair]
>[(null? item) 'empty-list]
>
Thanks Jon.
yes. I did, and you are right. I posted the same question a Google+ forum
(https://plus.google.com/108613325307702875646/posts/1BaDJFoat4D), and I
also got a reply that:
"John is being parsed as a variable, and thus, its binding is looked up in
the local environment. Of course, ther
On Sun, Jan 13, 2019 at 12:37 AM Hassan Shahin wrote:
> Thanks Jack and Mike!
>
> You are right. Arguments to procedures will be evaluated before the
> invocation of the procedure.
>
This is true, but it's not really the issue in your case. Even in #lang
lazy, which does not eagerly evaluate pro
Thanks Jack and Mike!
You are right. Arguments to procedures will be evaluated before the
invocation of the procedure. I thought that because (if) is not an ordinary
procedure, and because one can express if in terms of cond (or vice versa)
that my procedure is also a non ordinary procedure, wh
On Sat, 12 Jan 2019 at 21:12 -0800, Hassan Shahin wrote:
> When I apply the procedure to 'John it will evaluate to 'symbol. The idea
> of the procedure is to check the "type" of the given item, which is not
> decided aprior. If I give it 'John I know it is a symbol.
> May be my question should be
Thanks Mike.
When I apply the procedure to 'John it will evaluate to 'symbol. The idea
of the procedure is to check the "type" of the given item, which is not
decided aprior. If I give it 'John I know it is a symbol.
May be my question should be formulated as this: Since John is not a pair,
an
You need to apply the function to 'John, with a single quote in front of
it. The word John without that quote is just a variable reference to
something that you have not actually defined.
On Sat, Jan 12, 2019 at 11:34 PM Hassan Shahin wrote:
> I have this definition for a procedure:
>
> (define
I have this definition for a procedure:
(define type-of (lambda (item)
(cond
[(pair? item) 'pair]
[(null? item) 'empty-list]
[(number? item) 'number]
[(symbol? item)
8 matches
Mail list logo