Search code examples
lambda-calculusoz

How to use AND in Oz Programming language


declare
fun {Beta E}
    case E
    of lambda(X [Y Z]) andthen {IsAtom Y}  then Z
    else nil 
     end
    end

{Browse {Beta lambda(y [y a])   }}

I'm trying to make a beta reducer for lambda calculus but I don't know how to append arguments for Oz which I just started using.

What I want to do is: IsAtom Y and if(X==Y) then Z

I've tried "and, &&, &, andthen" but nothing really works. Oz documentation is just giving me headaches.


Solution

  • In Oz, And is a function not an operator. So to do an and operation you would do something like

    {And true false}
    

    Will yield false

    Here is a good reference manual.