Question: by using only basic operations can anyone help me? I'm able to get a list of just n - 1 but can't get the list

 by using only basic operations can anyone help me? I'm able

by using only basic operations can anyone help me?

I'm able to get a list of just n - 1 but can't get the list to continue to zero here's what i have so far:

fun makelist x = if null x then nil else hd x - 1 :: makelist(tl x);

This is in sml in case anybody didn't know, thank you in advance :)

- Write a function makeLst of type int -> int list that takes as input a positive integer n and returns the list [1, 2, ..., n]. Your function does not need to work with non-positive integer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!