Allowed Types for Noun Fields
| Write this |
Meaning |
| text |
words, names, any text |
| whole number |
counting numbers, no decimal point |
| decimal (or number) |
numbers that can have a decimal point |
| yes/no (or true/false) |
a simple true-or-false value |
| date |
a calendar date (written as text) |
| list of <type> |
many of that type, e.g. list of task |
Example as a Task Manager App
nouns:
task:
title: text
priority: whole number
done: yes/no
functions:
- name: count_unfinished
does: Count how many tasks are not yet done.
input:
tasks: list of task
output: whole number
examples:
- given:
tasks:
- {title: Email, priority: 2, done: false}
- {title: Report, priority: 1, done: false}
- {title: Lunch, priority: 3, done: true}
returns: 2
Common mistakes
- Leaving the example fields blank: delete the
examples, given, and
returns fields entirely.
- Plural after
list of: write list of task, not list of tasks.
- A type SpecForge doesn't know: use
whole number, not integer or
int; use yes/no, not boolean.
- Inconsistent indentation: use spaces, not tabs, and keep the same indent at each level.
- Forgetting the
- before a function: functions are a list; each one starts with a dash.
- A missing field in an example: every noun value in
given must include all of that noun's
fields.