Skip to content

Commit

Permalink
Merge pull request #1022 from WolframResearch/bugfix/456137
Browse files Browse the repository at this point in the history
Workaround for `Enclose` issue
  • Loading branch information
rhennigan authored Jan 13, 2025
2 parents aee3d3b + dda7781 commit 3be23a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/Chatbook/Common.wl
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,19 @@ expandThrowInternalFailures[ expr_ ] :=
ReplaceAll[
HoldPattern[ e$: lhs ] :> rhs,
HoldPattern @ Enclose[ eval_, throwInternalFailure, $enclosure ] :>
Enclose[ eval, throwInternalFailure[ e$, ##1 ] &, $enclosure ]
Module[ { eh = HoldComplete @ e$ }, Enclose[ eval, internalFailureFunction @ eh, $enclosure ] ]
]
];

expandThrowInternalFailures // endDefinition;

(* ::**************************************************************************************************************:: *)
(* ::Subsubsection::Closed:: *)
(*internalFailureFunction*)
internalFailureFunction // ClearAll;
internalFailureFunction // Attributes = { HoldAllComplete };
internalFailureFunction[ held_ ][ args___ ] := Replace[ held, HoldComplete[ e_ ] :> throwInternalFailure[ e, args ] ];

(* ::**************************************************************************************************************:: *)
(* ::Subsubsection::Closed:: *)
(*addEnclosureTags*)
Expand Down

0 comments on commit 3be23a2

Please sign in to comment.