Fictional Programming Language Logic Flashcards
7 cards from real Epic Skills Assessment practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Fictional Programming Language Logic flashcards as text
In FictoScript, a function declared with `fn*` instead of `fn` is:
Answer: A generator function that can yield multiple values lazily
`fn*` defines a generator that uses `yield` to produce values one at a time without computing all results upfront.
Which FictoScript keyword is used to handle errors from a function that may fail?
Answer: rescue
FictoScript uses `rescue` blocks (not `catch`) to handle errors thrown during execution.
In FictoScript, what is the result of applying `map(fn(x) => x * x, [1, 2, 3, 4])`?
Answer: [1, 4, 9, 16]
`map` applies the squaring function to each element, producing a new list of squared values.
FictoScript's `record` type differs from a plain `map` type in that a record:
Answer: Has fixed, named fields with defined types, while map allows arbitrary keys
A `record` has a fixed schema with typed fields, providing structure guarantees that a `map` does not.
What does the FictoScript pipe operator `|>` do?
Answer: Passes the result of the left expression as the first argument to the right function
`|>` chains function calls by passing the left-hand value into the next function, improving readability of transformation pipelines.
In FictoScript, a `contract` block attached to a function defines:
Answer: Preconditions and postconditions that are checked at runtime
A `contract` block specifies conditions that must hold before (`require`) and after (`ensure`) the function executes.
If FictoScript evaluates `true and false or true`, what is the result, assuming standard precedence?
Answer: true
`and` binds tighter than `or`, so this evaluates as `(true and false) or true` = `false or true` = `true`.