Alexis Lee <alexis(a)turton.com> writes:
> Yes, but just what can you _do_ with a function except rewrite it or
> call it? Function division and subtraction?!?
If you like. Personally, I tend to use them in catch statements and
other such things. Thunks are often handy, too.
> All the rewriting you might want to do deals with a function as a piece
> of text, and thus is better dealt with using existing string functions
> plus eval(). Not quite as syntactically pretty, but it does mean you're
> not duplicating the string library.
Functions aren't strings! Think about manipulating their parse
structure trees in a similar way to XSLT manipulating XML trees. No,
I don't do that quite so much with variables, but macros are powerful
tools.
> > Yes, but the power comes if you don't do bad cohesion like that and
> > you compose functions. I very rarely use begin... The time when I do
> > is when I'm trying to interface with something procedural, such as a
> > database.
> hum, I understood you were meant to start your program with a begin. I
> guess that's just a useful thing to do.
No, I hardly ever use it. You only start your program with begin if
you're making the popular mistake of writing procedural code, I think.
My recent programs (in guile) consist of a use-modules line, then a
single structure.
--
MJR Thesis watch: 27%
This is my personal web site =-> http://mjr.towers.org.uk/http://www.alug.org.uk/ <-- This is the LUG I go to
I work for this clever internet developer ==> http://www.luminas.co.uk/
It became apparent that, while Java is a good language for small
applications, Java is not adequate to address the needs of
current/future high-end applications, normally written in the much
more powerful and versatile C/C++ languages.
Java is slow, and requires all C/C++ applications to be completely
rewritten. Often, applications ported from C/C++ to Java produces
product at high cost.
from http://ivm.sourceforge.net/icvmcpp.html
So, Java is doomed now?
--
MJR Thesis watch: 27%
This is my personal web site =-> http://mjr.towers.org.uk/http://www.alug.org.uk/ <-- This is the LUG I go to
I work for this clever internet developer ==> http://www.luminas.co.uk/
I'm moving to stick this on social.
Quote from the news article I finally accessed:
--
Suppose someone else used a language called Kwook and was trying to
understand the benefit of first-class integers in C. He might point out
that in Kwook, you can declare an integer like this:
int four_hundred_eight = 408;
Then whenever you need 408 to be the argument to a function, you just
pass a pointer to the four_hundred_eight integer. If a function (say,
addition), needs to return 408, just return the same pointer.
How would you explain to the Kwook programmer that first-class integers
are better?
--
OK, I can see why it's a pain having to reference and dereference by
hand. Does first-class mean that references are constructed autom., or
that the thing can be copied? I see no point in copying a thing unless
it can be altered.
And if the point is to be able to create a copy of a function which can
be altered, what's wrong with
(let ((a "display") (b "hello"))
(eval list(a " " b))
)
(or equivalent written in non-babytalk Scheme).
MJ Ray wrote:
> What is a Cache object? Yes, that's a philosophical question ;-)
An object which holds references to other objects (held locally) to allow
faster retrieval thereof.
I'd guess you could do something funky to try and ensure that all those
objects were held in RAM at all times.
I think I see why you think it's a philosophical question, but the idea of
recursive caches isn't all that interesting, so perhaps I missed it.
> Yep, Guile is Scheme. And how many current browsers include JREs?
> Isn't that a dying trend? Java is surely a language which has had its
> day in the sun... now to see how it weathers a winter.
True, Java isn't being shipped with IE6, it's an installable component. But
I believe Mozilla still has it. And Java is apparently achieving massive
growth in the embedded/handheld device markets.
It has the massive advantage of being structural (or procedural or whatever
I'm meant to call it... Cish), which is how most people learn to think when
they're taught to program.
Incidentally, if you do this:
(begin (define function1 (lambda (x) (...)))
(define function2 (lambda (x y) (...)))
(function1 2.5)
(display (function2 3.8 "Hello"))
)
doesn't that look rather structural? I'm really struggling to get a grip
on this functional stuff.
> Huh? My personal site is entertainingly broken at the moment (try it
> in moz), but I don't recall there being any non-relative internal URLs
> on it, as that's a pet hate of mine.
http://mjr.towers.org.uk/ from your sig.
Left nav bar. Moz 0.9.2.
Alexis
--
"You got what everyone gets. A lifetime." - Death (Sandman by Neil Gaiman)
"I respect faith, but doubt is what gives you an education" - Wilson Mizner
"It doesn't matter who you vote for. The government always gets in."
Alexis Lee <alexis(a)turton.com> writes:
> I'm moving to stick this on social.
Followed.
> OK, I can see why it's a pain having to reference and dereference by
> hand. Does first-class mean that references are constructed autom., or
> that the thing can be copied? I see no point in copying a thing unless
> it can be altered.
It means that you can do whatever you like with it, just as any other
variable, pretty much.
> And if the point is to be able to create a copy of a function which can
> be altered, what's wrong with
> (let ((a "display") (b "hello"))
> (eval list(a " " b))
> )
> (or equivalent written in non-babytalk Scheme).
If you're using eval with user input, you have serious problems.
> True, Java isn't being shipped with IE6, it's an installable component. But
> I believe Mozilla still has it.
No, it's a downloadable component in current moz.
> And Java is apparently achieving massive
> growth in the embedded/handheld device markets.
"Massive growth" is probably apt given Java's famous memory
requirements. Well, there are scheme interpreters too, and they're
easier and smaller to create.
> It has the massive advantage of being structural (or procedural or whatever
> I'm meant to call it... Cish), which is how most people learn to think when
> they're taught to program.
Only in the UK and it doesn't make it right.
> Incidentally, if you do this:
> (begin (define function1 (lambda (x) (...)))
> (define function2 (lambda (x y) (...)))
> (function1 2.5)
> (display (function2 3.8 "Hello"))
> )
> doesn't that look rather structural? I'm really struggling to get a grip
> on this functional stuff.
Yes, but the power comes if you don't do bad cohesion like that and
you compose functions. I very rarely use begin... The time when I do
is when I'm trying to interface with something procedural, such as a
database.
> > Huh? My personal site is entertainingly broken at the moment (try it
> > in moz), but I don't recall there being any non-relative internal URLs
> > on it, as that's a pet hate of mine.
> http://mjr.towers.org.uk/ from your sig.
> Left nav bar. Moz 0.9.2.
I see no relative links. You do know the towers.org.uk thing is a
redirect? (Anyone else want one?)
--
MJR Thesis watch: 27%
This is my personal web site =-> http://mjr.towers.org.uk/http://www.alug.org.uk/ <-- This is the LUG I go to
I work for this clever internet developer ==> http://www.luminas.co.uk/
Hi all,
just found this link to a java version of the text based hitch-hikers
guide to the galaxy adventure game.....
http://www.douglasadams.com/creations/infocomjava.html
Do you know where YOUR towel is??
Adam
--
This message is Copyleft - all rights reversed
Adam
Adam Bower <abower(a)thebowery.co.uk> writes:
> The LBW was really great! there was much beer drinking and a good time was
> had by all. There was talk of going to the Czech republic for a future LBW
> but there is a lack of people who are able to organise things there.
Yep, after Belgium and Germany, the Czech Rep has got to be one of the
great beer places to visit. However, you would definitely need enough
local guides to keep you out of trouble and many visitors would need
visas.
--
MJR
This is my personal web site =-> http://mjr.towers.org.uk/http://www.alug.org.uk/ <-- This is the LUG I go to
I work for this clever internet developer ==> http://www.luminas.co.uk/