aspose file tools*
The moose likes Other Languages and the fly likes I need help with a very simple ML program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "I need help with a very simple ML program" Watch "I need help with a very simple ML program" New topic
Author

I need help with a very simple ML program

Van Johnson
Greenhorn

Joined: Oct 16, 2013
Posts: 7
Please tell me what is wrong with this program. Screen shot attached. Thanks.



[Thumbnail for wrong ml code is_older.png]

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

Hello Van, welcome to the Ranch!

Is there a program in that screen shot? I can't read it, the text (if that's what it is) is way to small. Could you just copy the text and paste it here?
Van Johnson
Greenhorn

Joined: Oct 16, 2013
Posts: 7
I don't know how to get the text info out of the Emacs window that SML is running in (can't copy w/ normal windows commands), and I'm too tired to write it in note pad right now. However I'm able to click on the screenshot and enlarge the view and it is quite viewable for me. Thanks for responding!
Tim Cooke
Bartender

Joined: Mar 28, 2008
Posts: 1132
    
  59

The code after your andalso:

is attempting to perform a less than operation on two int list types. This is the source of your error.

Given the timing and the fact that I recognise the function I assume that you are working on Dan Grossman's Programming Languages course on Coursera? I am also doing this course so best of luck with it, and if you get my assignment for peer review please be kind....

If this function is for the assignment then you might want to review the function signature requirements as I think as it stands your function will fail the auto grader. The required signature is:

and your current signature is


Tim Driven Development
Van Johnson
Greenhorn

Joined: Oct 16, 2013
Posts: 7
Thanks a lot for the help. I looked everywhere for how to define a tuple in an function and couldn't find it anywhere. You've saved me a lot of frustration. Now to try it out...
Yes this is for Grossman's PL class, but I'm pretty far behind because of time constraints so I probably won't be doing any peer assessments. I'm so glad I found a good site to ask for help.
Van Johnson
Greenhorn

Joined: Oct 16, 2013
Posts: 7
OK, I guess I just don't know how to access the items in a tuple. It seems that the 'tl' command can't be used on a tuple, is that right?. Attached is another try at making the function work, along with error messages. Thanks again for any help I may receive.


[Thumbnail for another try at is_older.png]

Van Johnson
Greenhorn

Joined: Oct 16, 2013
Posts: 7
ok, I've figured it out. hashtag, duh.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Van Johnson wrote:I don't know how to get the text info out of the Emacs window that SML is running in (can't copy w/ normal windows commands)

If you need to do this again, there is an easy way. Navigate to the directory containing the file in finder, right click the sml file and open in NotePad or TextEdit or whatever the plain text editor is on your system.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Tim Cooke
Bartender

Joined: Mar 28, 2008
Posts: 1132
    
  59

Van Johnson wrote:hashtag, duh.

Very witty. Deserved of a nerdy grin.

Glad you got it sorted. Best of luck with the course.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I need help with a very simple ML program