Subject: Re: [Ffc] [Branch ~ffc-core/ffc/dev] Rev 1594: Add comment about how to deal correctly with warnings vs expections.

From: Kristian Oelgaard <[email-masked]>
Date: Sat, 30 Jan 2010 15:15:40 +0100 (CET)

Can't we just catch exceptions in the regression tests? Or is that inconvenient because all function tests are in the same cpp file?
To implement your solution I guess we just need another function like the set_float_formatting()
which does:
  format["exception"] = format["warning"]
this function can be called from compiler.py when checking the options, will that work?

Kristian

On 30 January 2010 00:23,  <[email-masked]> wrote:
> ------------------------------------------------------------
> revno: 1594
> committer: Anders Logg <[email-masked]>
> branch nick: ffc-dev
> timestamp: Sat 2010-01-30 00:21:06 +0100
> message:
>  Add comment about how to deal correctly with warnings vs expections.
>  I think I figured out the correct solution, but it doesn't have to
>  be implemented now.
> modified:
>  ffc/cpp.py
>
>
> --
> lp:~ffc-core/ffc/dev
> https://code.launchpad.net/~ffc-core/ffc/dev
>
> You are subscribed to branch lp:~ffc-core/ffc/dev.
> To unsubscribe from this branch go to https://code.launchpad.net/~ffc-core/ffc/dev/+edit-subscription.
>
> === modified file 'ffc/cpp.py'
> --- ffc/cpp.py  2010-01-29 23:18:30 +0000
> +++ ffc/cpp.py  2010-01-29 23:21:06 +0000
> @@ -18,10 +18,17 @@
>
>  # FIXME: AL: This files needs cleaning up!
>
> +# FIXME: AL: In places where we have non-implemented functions
> +# FIXME: print a warning message instead of throwing an exception
> +# FIXME: we should throw an exception and instead have a command-line
> +# FIXME: option for converting exceptions to warnings that can be
> +# FIXME: used from the regression test script.
> +
>  # Formatting rules
>  # FIXME: KBO: format is a builtin_function, i.e., we should use a different name.
>  format = {}
>
> +
>  # Program flow
>  format.update({"return":      lambda v: "return %s;" % str(v),
>                "grouping":    lambda v: "(%s)" % v,
>
>
>

---

From: Anders Logg <[email-masked]>
Date: Sat, 30 Jan 2010 20:11:35 +0100

I thought about catching the exceptions, but it would make the
ufctest.h file even more complicated. But the format["exception"] =
format["warning"] trick is a good idea. I'm working on adding it.

--
Anders

> _______________________________________________
> Mailing list: https://launchpad.net/~ffc
> Post to     : [email-masked]
> Unsubscribe : https://launchpad.net/~ffc
> More help   : https://help.launchpad.net/ListHelp