Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling Java exceptions #136

Open
zonyitoo opened this issue Mar 19, 2015 · 11 comments
Open

Handling Java exceptions #136

zonyitoo opened this issue Mar 19, 2015 · 11 comments

Comments

@zonyitoo
Copy link

There is no way to handle/raise exception in F2J, so I cannot even read a file.

Also for #108 .

@zhiyuanshi
Copy link

Any one working on this?

@bixuanzju
Copy link
Contributor

@zhiyuanshi I think no one

@zhiyuanshi
Copy link

@zonyitoo Could you provide a minimal program that exhibits the issue?
@bixuanzju I assign this to myself now. After I've sorted out the frontend, I'll reassign the backend part to you.

@zhiyuanshi zhiyuanshi self-assigned this Mar 28, 2015
@bixuanzju
Copy link
Contributor

@zhiyuanshi sure!

@zonyitoo
Copy link
Author

first example, the simplest,

exception LogicalException String

def head[A] (l : List[A]) : A =
    case l of
        Nil         -> raise (LogicalException "Call `head` on an empty List")
     |  Cons x _    -> x

@zhiyuanshi
Copy link

First we handle Java exceptions and then make our own as Java exceptions. :) So what I need is a F2J program that uses Java file I/O and the resulting Java program should not be able to be compiled by javac due to the fact that exception is not caught.

@zonyitoo
Copy link
Author

@zhiyuanshi So you want a program that cannot be complied? That is easy ;)

def readFileToString (name : String) : String =
    (new java.util.Scanner(new java.io.File(name))).useDelimiter("\\Z").next()

@zhiyuanshi
Copy link

@zonyitoo Oh great. I like it.

@bixuanzju
Copy link
Contributor

What's the status now?

@zhiyuanshi
Copy link

@xnning Wondering if you're handling this for us at the moment?

@xnning
Copy link
Contributor

xnning commented Apr 30, 2015

@zhiyuanshi Nope. Pull request #168 provides a error operation (needed to be polished), which is more related to #108 .

@bixuanzju bixuanzju removed the blocker label Jun 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants