Sum Scan No Identity Element Assignment

From CSE425S Wiki
Revision as of 05:15, 21 January 2023 by Dennis.cosgrove (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Reimplement Sum Scan with no identity element.

Background

A clean solution to sum_scan can be achieved by leveraging sum's Identity element of 0. The coming scan higher order function exercise must make do without this information. Since we often only use the identity element (if we use it at all) to apply with the value of first item in a list to get that value of the first item in the list back again, this should not be the greatest inconvenience.

Code to Implement

file: src/main/sml/warmup_sum_scan_no_identity_element/sum_scan_pattern.sml Smlnj-logo.png
functions: sum_scan

Test

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

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

SML Error Messages