1 — Start Me Up
Due Thursday, 11 September 2026, 11:59:59pm
to create a program that can be run on the command line, reads from STDIN, and writes to STDOUT.
to formulate one integration test as specified in the testing task below;
to get to know the S-expression (see S-expression Readers) library of your chosen programming language;
to study a data representation for a self-referential form of information representation according to the principles of Fundamentals I or II; and
to implement a simple piece of functionality (functions, methods) for this data representation according to the principles of Fundamentals I or II.
Delivery Deliver your solutions in a directory called 1 within your assigned GitHub repository. The directory should contain the following items:
the executables xcount as specified below;
the sub-directory 1/Tests/ with the required integration test; and
an optional sub-directory called 1/Other/ for all auxiliary files.
An Example is one of:
– a Name
– a Number
– a sequence of space-separated Examples wrapped in ( and ).A Name is a non-empty sequence of at most 20 (US alphabetical) letters.
A Number is a decimal number (contains a decimal point) between -1000.0 and +1000.0, with at most one digit to the right of the decimal point.
Nothing else is an Example.
The xcount program reads one Example from STDIN, determines the number of Names in the given S-expression, and writes this count to STDOUT as a String (including the quotes).
You may assume that the input is always an instance of Example.
Testing Task Create one integration test for xcount.
A test always consists of inputs, expected
output, and an automated procedure for comparing the actual output
with the expected one. —
$ cat Tests/0-in.ss |
aName |
$ cat Tests/0-out.ss |
"1" |
$ ./xcount < TestsCount/0-in.ss | diff - TestsCount/0-out.ss |
Readings Language and Pragmatics