FreshPorts -- The Place For Ports notbugIf you buy from Amazon USA, please support us by using this link.
Follow us

Help with ports
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Re: Caml Functions i need help with
Author: danp 
Date:   03-03-04 21:53

Sounds like a homework problem ... If you have specific questions, then you should ask those (maybe on a more appropriate forum ;). I'm not sure what help you are expecting here.

Here's how I'd think about the CountNi problem: As the problem states, you want a function that takes a list and returns a number. What can you do with a list? If you look at the example functions that you must surely have, you'll see that you can look at a list as a head and a tail. The head is an integer. It's easy to tell if an integer is negative or not. The tail is list. What can be done with that? [slams fist into hand] If only we had a function that counted the negative integers in a list -- oh, wait, CountNi does that. Sounds kind of recursive don't you think? ;) The preceding case handles everything except where there is no head, i.e. the empty list. It's easy to count the negative integers in an empty list.

The second problem sounds tricky ... It seems a little underspecified to me. Are you allowed to use library modules? I'm guessing that a particular module in the standard library might be useful.

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 Caml Functions i need help with   new
P--K 02-03-04 16:16 
 Re: Caml Functions i need help with   new
danp 03-03-04 21:53 

 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.

Servers and bandwidth provided by
New York Internet, SuperNews, and RootBSD
Valid HTML, CSS, and RSS.
Copyright © 2000-2018 Dan Langille. All rights reserved.