예제 #1
0
from oslash import put_line, get_line

main = put_line("What is your name?") | (lambda _:
    get_line() | (lambda name:
    put_line("What is your age?") | (lambda _:
    get_line() | (lambda age:
    put_line("Hello " + name + "!") | (lambda _:
    put_line("You are " + age + " years old"))))))

if __name__ == "__main__":
    main()
예제 #2
0
from oslash import put_line, get_line

main = (put_line("What is your name?")
        | (lambda _: get_line()
           | (lambda name: put_line("What is your age?")
              | (lambda _: get_line()
                 | (lambda age: put_line("Hello " + name + "!")
                    |
                    (lambda _: put_line("You are " + age + " years old")))))))

if __name__ == "__main__":
    #print(main)
    main()
예제 #3
0
파일: hello.py 프로젝트: cbenz/OSlash
from oslash import put_line, get_line

main = put_line("What is your name?") | (lambda _:
        get_line() | (lambda name:
        put_line("What is your age?") | (lambda _:
        get_line() | (lambda age:
        put_line("Hello " + name + "!") | (lambda _:
        put_line("You are " + age + " years old"))))))

if __name__ == "__main__":
    main()
예제 #4
0
파일: hello.py 프로젝트: caiorss/OSlash
from oslash import put_line, get_line

main = put_line("What is your name?") >> (lambda _:
    get_line() >> (lambda name:
    put_line("What is your age?") >> (lambda _:
    get_line() >> (lambda age:
    put_line("Hello " + name + "!") >> (lambda _:
    put_line("You are " + age + " years old"))))))

if __name__ == "__main__":
    main()
예제 #5
0
파일: hello3.py 프로젝트: stjordanis/OSlash
"""Hello example using do-notation."""
from oslash import put_line, get_line, do, let

main = do(put_line("What is your name?"), let(name=get_line()),
          put_line("What is your age?"), let(age=get_line()),
          lambda e: put_line("Hello " + e.name + "!"),
          lambda e: put_line("You are " + e.age + " years old"))

if __name__ == "__main__":
    #print(main)
    main()