Posted by Steve
on June 06, 2004
Final Year Project /
No Comments
On the SML newsgroup someone asked the following
> hello!
> i have think how to do something like this:
> for example i have
> [1,3,2,1,2,4,2,1,3,4]
> and i want to get
> [1,3,2,4]
>
> The idea is to delete repeted elements.
> can someone help me?
The response was
“Recursive thinking”:
1) Write the (trivial) algorithm that handles a one-element list.
2) Write the algorithm that handles a list of N elements. If you take
the list apart into (a) its first element and (b) a rest list of N-1
elements, you can recursively call your function on the rest list, so
all you have to consider now is the case if you have a new element and
ponder whether it should be made part of the list or not.
Consider varying the result. Will the program become simpler if you do
step (1) with a zero-element list?
Feel free to ask more if this doesn’t get you going.
I know how I’d write a function to do that and I don’t think that response was in the least helpful. Infact I’m now slightly more confused. It really does make me wonder sometimes.
Posted by Steve
on June 04, 2004
Final Year Project /
No Comments
Now further to my recent post on the GUI for my final year project. I’m now absolutly conviced noone does GUIs with SML. I posted a question on the usually busy newsgroup - no answer. Also searching on google; most of the hits are links to the project homeopage stating its existence and not much else and low and behold. My website - number 25. D’oh. When you find your own website asking the questions it’s time to give up if you haven’t already found the answer
Posted by Steve
on June 03, 2004
Uncategorized /
No Comments
Hmmm, right.
I just found this referrer in my logs
http://intranet.mi5.gov.uk/websites_to_monitor/
Subtle Guys - I wonder who it actually is.
Posted by Steve
on June 01, 2004
Final Year Project /
No Comments
I wrote down a ‘todo’ list for my project today - bad idea. I have got lots to do and whilst some of it should be quite quick now I’ve worked out the easy way to do it you never can tell. I have just spent the past day trying to work out why one of my functions keeps causing an exception whenever I try to run it.
I’d also like to see some examples for the graphical system I’m trying to use. Lots and lots of people appear to be talking to it but whenever you google for it you just get a load of pages linking to the project homepage. I’m beginning to doubt whether anyone ever uses sml_tk. I think all they do is talk about using it. All I want to know is how I call an external function. Another thing I’ve noticed is lots of people calling about 2 A4 pages of function listings ‘Documentation’. grr
I’ll stop being angry now. On the plus side I’m getting into this functional programming lark now.
So much to do and so little time. Which is obviously why I’m wasting my time writing this…..