Week 2 introduction2

 0    6 informačný list    up804653
stiahnuť mp3 vytlačiť hrať Skontrolujte sa
 
otázka English Odpoveď English
What are guards?
začať sa učiť
Guards are Boolean expression used in function definitions to givealternative results dependent on the parameter values
Haskal contains guards and what other simmilar function?
začať sa učiť
if... then... else...
how is a guard denoted?
začať sa učiť
maxThree: Int -> Int -> Int -> IntmaxThree x y z| x >= y && x >= z = x| y >= z = y| otherwise = z
how are local definitions denoted?
začať sa učiť
the keyword "where" eg where /n dxSq = (x1 - x2)ˆ2 /n dySq = (y1 - y2)ˆ2
CAn local definitions be used outside of the function they are defined in?
začať sa učiť
Local definitions can only be used within the functions that theyare defined; they are “hidden” from the rest of the program.
Local definitions can be used as function parameters true or false?
začať sa učiť
true

Ak chcete pridať komentár, musíte byť prihlásený.