-
Notifications
You must be signed in to change notification settings - Fork 1.2k
lazy exception patterns #6423
Copy link
Copy link
Closed
Description
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 eis equivalent to
eEventually lazy patterns could support or patterns for exception matching (cf. PR6422):
match f e with
lazy (None | exception Not_Found) -> ...
| ...
Reactions are currently unavailable