ask_question/5

Description

ask_question(Question, Kind, Component, Check, Answer)

Built-in method for asking a question represented by a term, Question, which is converted to the question text using the logtalk::message_tokens(Question, Component) hook predicate. This method is declared in the logtalk built-in object as a public predicate. The default question prompt and the input stream used for each Kind-Component pair can be found using the logtalk::question_prompt_stream(Kind, Component, Prompt, Stream) hook predicate. The Check argument is a closure that is converted into a checking goal by extending it with the user supplied answer. This predicate implements a read-loop that terminates when the checking predicate succeeds.

This predicate starts by calling the logtalk::question_hook(Question, Kind, Component, Check, Answer) hook predicate. If this predicate succeeds, the ask_question/5 predicate assumes that the question have been successfully asked and replied.

Modes and number of proofs

ask_question(+nonvar, +nonvar, +nonvar, +callable, -term) - one

Meta-predicate template

ask_question(*, *, *, 1, *)

Errors

(none)

Examples

...,
logtalk::ask_question(enter_age, question, my_app, integer, Age),
...