On this page:
1.1 Condition special elements
special-condition?
flag-condition?
condition?
condition-string?
1.2 Condition struct
pcondition
1.3 Condition conversion
condition->string
string->condition
1.4 Condition querying
pcondition->contents
8.12

1 Condition🔗ℹ

 (require pmsf/condition) package: pmsf-condition

1.1 Condition special elements🔗ℹ

 (require pmsf/condition/condition) package: pmsf-condition

procedure

(special-condition? v)  boolean?

  v : any

Examples:
> (special-condition? 'at-most-one)

#t

> (special-condition? 'exclusive-or)

#t

> (special-condition? 'inclusive-or)

#t

procedure

(flag-condition? v)  boolean?

  v : any

Examples:
> (flag-condition? "test")

#t

> (flag-condition? '(not . "test"))

#t

procedure

(condition? v)  boolean?

  v : any

Examples:
> (condition? 'at-most-one)

#t

> (condition? "test")

#t

procedure

(condition-string? v)  boolean?

  v : any

Examples:
> (condition-string? "test?")

#t

> (condition-string? "!test?")

#t

> (condition-string? "??")

#t

> (condition-string? "^^")

#t

> (condition-string? "||")

#t

1.2 Condition struct🔗ℹ

 (require pmsf/condition/struct) package: pmsf-condition

struct

(struct pcondition (condition contents)
    #:extra-constructor-name make-pcondition
    #:transparent)
  condition : condition?
  contents : (listof any)

Example:
> (pcondition '(not . "test") '("test"))

(pcondition '(not . "test") '("test"))

1.3 Condition conversion🔗ℹ

 (require pmsf/condition/convert) package: pmsf-condition

procedure

(condition->string input-condition)  condition-string?

  input-condition : condition?

Examples:
> (condition->string "test")

"test?"

> (condition->string '(not . "test"))

"!test?"

> (condition->string 'at-most-one)

"??"

> (condition->string 'exclusive-or)

"^^"

> (condition->string 'inclusive-or)

"||"

procedure

(string->condition input-string)  condition?

  input-string : condition-string?

Examples:
> (string->condition "test?")

"test"

> (string->condition "!test?")

'(not . "test")

> (string->condition "^^")

'exclusive-or

> (string->condition "??")

'at-most-one

> (string->condition "||")

'inclusive-or

1.4 Condition querying🔗ℹ

 (require pmsf/condition/query) package: pmsf-condition

procedure

(pcondition->contents input-pcondition)  (listof any)

  input-pcondition : pcondition?
Extract contents of given pcondition, all conditions are thrown away.

Example:
> (pcondition->contents
   (pcondition "gui"
               (list "client"
                     (pcondition "qt5"
                                 (list '(not . "aqua")
                                       "X")))))

'("client" (not . "aqua") "X")