My Length Assignment

From CSE425S Wiki
Revision as of 16:03, 30 August 2024 by Dennis.cosgrove (talk | contribs) (→‎Functions to Use)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code to Use

List

  • null is the passed in list empty?
  • tl tail list of the passed in list

Code to Implement

file: src/main/sml/warmup_my_length/my_length.sml Smlnj-logo.png
functions: my_length

my_length

Write a function my_length which evaluates to the length of the given values list.

  • what is the base case?
  • what is the general (recursive) case?
fun my_length(values) =
	raise Fail "NotYetImplemented"

Test

source folder: src/test/sml/warmup_my_length
how to run with CM.make verbosity off: sml -Ccm.verbose=false run_my_length_testing.sml
how to run with CM.make verbosity on: sml run_my_length_testing.sml

note: ensure that you have removed all printing to receive credit for any assignment.

SML Error Messages