SWI-Prolog / packages-pengines

Pengines: Prolog engines
11 stars 13 forks source link

Missing brackets in output_result/3 ? #43

Closed ridgeworks closed 5 years ago

ridgeworks commented 5 years ago

SWI-Prolog V8.1.1 Not sure what the end result is but is the clause for pengines:output_result handling JSON replies missing brackets in ->:

output_result(Lang, Event, _) :-
    json_lang(Lang),
    !,
    (   event_term_to_json_data(Event, JSON, Lang)
    ->  cors_enable,
        disable_client_cache,
        reply_json(JSON)
    ;   assertion(event_term_to_json_data(Event, _, Lang))
    ).

i.e., you only want to reply_json(JSON) if event_term_to_json_data/3 succeeds.

ridgeworks commented 5 years ago

I'm closing this issue. Think I'm just confused about semantics of C->T1,T2;E.