Talk:Object disoriented

From Esolang

Jump to: navigation, search

When was this language created? --Aardwolf 16:07, 14 Nov 2005 (GMT)

Around week ago.

Admit it. You just wanted a language where "fap fap fap..." was legal. ;->

Heheh... I actually considered rewriting that function so that it goes fbp fbp fbp fbp instead, honest! ...But then I thought nobody would notice or care. :)

I also noticed that one, though I can't remember which comic it is from. But I do remember what sound it was meant to represent... --Rune 22:32, 15 Nov 2005 (GMT)

[edit] Implementation

I am working on an implementation of this language in C++. It uses continuation passing style with a trampoline to allow 'infinite' recursion (limited by heap memory, not stack space). I am having problems running the example programs though; I would like to clarify a point in the spec. Are the a and b objects references to the values that initialised them? If so what happens if they are initialised to null (since this would prevent any assignment to them)? The example hello world seems to assume they are references, but then assigns to a null reference. --Sphen lee 08:20, 11 February 2008 (UTC)

It would appear to me that objects have value semantics, and that the null object is an actual object rather than a null object reference. -- Smjg 02:17, 13 March 2008 (UTC)

[edit] Omissions

Is this language case-sensitive?

What are the rules on what's a valid class name?

What should fz* do - return z, return *, throw a runtime error or what? -- Smjg 02:17, 13 March 2008 (UTC)

My implementation assumes that code is case sensitive, that class names can contain any character except dot, and that fz* is a runtime error. If you are implementing this language too I would be very interested to see if you can get the hello world program to work. After changing to value semantics as you suggested I am getting the fz* error... --Sphen lee 07:40, 13 March 2008 (UTC)
Just thinking about it, if objects have value semantics, members a and b would have to be pointers to these values. So effectively, an object would be
struct Object {
  Object *a, *b;
}
and when a or b is passed in as a function argument, it is this pointer that is passed. Is this what your implementation assumes? I'm also inclined to assume that c is a shallow copy (i.e. just copies the object in the first argument into the destination referred to by the second, and doesn't duplicate the child objects), but I'm not sure.
Here's another difficulty: What if a reference to a read-only object is passed to a function, and the function tries to modify it?
It would help if the creator of the language could clarify these issues. But meanwhile, I could still have a go at implementing it according to my interpretations. -- Smjg 00:05, 3 April 2008 (UTC)
I am using an Object class similar to that struct. My c performs a shallow copy. I have set up my copy operation so that if you attempt to copy a value into a null reference (ie. initialised to z) it will create a reference, otherwise it assigns to the reference. In pseudo C it looks like this:
if(!copyTarget)
    copyTarget = &value;
else
    *copyTarget = value;
I am no longer getting the fz* error in the Hello World program, but I seem to be getting an infinite loop instead...
Are we certain that the Hello world program should work? It uses assignment to self, which the author states hasn't been clarified yet. --Sphen lee 13:15, 14 April 2008 (UTC)
Personal tools