Equality and Circular Lists

2 views
Skip to first unread message

Philip White

unread,
Nov 16, 2009, 9:46:41 PM11/16/09
to Programming Nu
Hello,
I hope I'm not too late hopping on this Nu bandwagon. I really enjoy
working (playing mainly, so far) in this language and exploring its
inner workings. I hope it continues to be enthusiastically used and
supported by the community.

I was wondering if I am correct in believing that Nu is missing a
way to tell if two objects are identical (i.e. the same instance;
occupy the same place in memory). Much as Common Lisp has several ways
to make comparisons (eq, eql, etc.), this could be a valuable addition
to Nu. Or maybe I'm just overlooking something. I looked through the
source but couldn't find any such thing.

So maybe that's a trivial point, it certainly isn't difficult to add
a category to NSObject in Objective C to add that behavior, but I
think the profound thing is that without it it makes certain things
impossible to do in Nu.

For instance: consider circular lists. NuCell has several methods
that don't behave well with circular lists; in fact, it crashes Nu
entirely to try to compare a circular list to itself. If you try,
isEqual: recurses indefinitely until KABOOM! But more importantly,
since you can't compare NuCells that are elements in circular lists, I
don't think there is anyway to use Nu to test if a list is circular.
Of course, maybe a circular list is one of those things that doesn't
need to exist, or if you need one, you should make a custom class to
implement it. But the fact is you can create one easily in Nu, maybe
accidentally, and then you have a very dangerous object floating
around.

Heck, why not revamp NuCell's various method so that they behave OK
with circular lists? Some of them, like -lastObject, might just throw
an exception if it detects a circular list; others, like isEqual:,
could compare circular lists correctly without too much difficulty. I
don't think this would be too much of a performance hit. I'll run some
tests to see (sounds fun!).

Anyway, in my unsolicited opinion, I think Nu needs to ability to test
for identicality (is that a word? and do please let me know if there
is a way I missed) and NuCell should handle circular lists gracefully.

Thanks for all of your time and Tim, thanks for making this awesome,
inspired language.

-Philip White

stephen white

unread,
Nov 17, 2009, 3:31:04 AM11/17/09
to program...@googlegroups.com
On 17/11/2009, at 1:16 PM, Philip White wrote:
> I hope I'm not too late hopping on this Nu bandwagon. I really enjoy
> working (playing mainly, so far) in this language and exploring its
> inner workings. I hope it continues to be enthusiastically used and
> supported by the community.

You're not too late... the lack of activity is because Nu doesn't need
any more development for now.

Objective C 2.0 blocks could be a good addition to Nu at some point
though. :)

--
st...@adam.com.au


Jason Grossman

unread,
Nov 17, 2009, 5:33:17 AM11/17/09
to Programming Nu


On Nov 17, 7:31 pm, stephen white <st...@adam.com.au> wrote:

> You're not too late... the lack of activity is because Nu doesn't need  
> any more development for now.

I'm sure this is right. The way Nu uses the Cocoa / GNUStep libraries
means it's already very mature.

Tim, any chance of adding a note explaining this on the web site?
Looking at the web site these days is a bit dispiriting: no posts for
almost a year makes it LOOK like Nu is dead, even though I know it's
absolutely not. I wonder how many potential Nu developers are being
put off by the incorrect assumption that if the web site is stagnant
then the language is too. (See Ambrai Smalltalk for a sad example of
when that assumption is correct!)

Jason

Tim Burks

unread,
Nov 17, 2009, 12:53:30 PM11/17/09
to program...@googlegroups.com
Hi Jason,

I'll post some updates to go with the new release. I have been much
busier this year than in the past few, but am using Nu a lot. This
summer Jeff Buck and I ported it to Debian Linux and got it running on
Rackspace Cloud Servers, and in September we met in Chicago to work
some tools for managing Nu cloud services. Most of this is open source
and available through my github account.

Also, I'd be happy to take contributions to the web site -- the source
is on github:
http://github.com/timburks/programmingnu

thanks!

Tim

Jason Grossman

unread,
Nov 17, 2009, 1:49:15 PM11/17/09
to Programming Nu
Hi, Tim.

Some misunderstanding, I think. I WASN'T complaining about lack of
activity! I was suggesting that the web site say something about Nu
being mature and still going.

Thanks for all the great work.

Jason

Tim

unread,
Nov 17, 2009, 10:44:01 PM11/17/09
to Programming Nu
Hi Philip,

Thanks for working with Nu! I'm not knowingly using circular lists so
I haven't felt that particular pain.

Generally my goals with Nu were to expose more of C (and Objective-C)
than other Lisps allowed. I'm comfortable with the resulting
environment being a little dangerous, but improvements would be very
welcome. So if you would like to work on this, please do! (and tell us
what you do with Nu!)

Tim
Reply all
Reply to author
Forward
0 new messages