Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Is there a ternary operator in FunC?

Many programming languages have a ternary operator, such as booleanExpression ? expression1 : expression2 in Java (if booleanExpression equals true, than expression1 gets executed, if not, than expression2 gets executed). Is there such an operator in FunC? Where in the documentation it is described?


This question was imported from Telegram Chat: https://t.me/tondev/47869

1
1
Posted one year ago
Votes Newest

Answers


There is such an operator; the documentation calls ita "conditional operator".

https://ton.org/docs/develop/func/statements#conditional-operator

This is the example provided:

;; <condition> ? <consequence> : <alternative>
x > 0 ? x * fac(x - 1) : 1;
1
1
Posted one year ago
Edited one year ago
Jeremy
384 × 5 Administrator
  
  

Just remember to use space around ? and :.

Behrang Norouzinia   one year ago Report
17K Views
1 Answer
one year ago
one year ago
Tags