Skip to content

lazy exception patterns #6423

@vicuna

Description

@vicuna

Original bug ID: 6423
Reporter: @yallop
Status: acknowledged (set by @damiendoligez on 2014-06-02T18:29:00Z)
Resolution: open
Priority: normal
Severity: feature
Category: language features
Related to: #6318 #6422
Monitored by: @whitequark @hcarty

Bug description

The idea is to support exception matching under lazy patterns, as Alain proposed in discussion under PR6318. For example, we might write:

   match f e with
     lazy x, _                           -> ...
   | lazy (exception Not_found), Some x  -> ...
   | ...

Unlike top-level exception patterns which can only appear in 'match' and 'try', we can support exception pattern under lazy in any pattern context. For example,

   let (lazy (exception E)) = raise E in e

is equivalent to

   e

Eventually lazy patterns could support or patterns for exception matching (cf. PR6422):

match f e with
lazy (None | exception Not_Found) -> ...
| ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions