[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Argument blocks, value: and -infinity.

  I am having difficulty finding my copy of the Self manual,
and Danny Epstein isn't to be found, so I can't borrow his. I thought
I was beyond having to look up syntax :-)

  How do I declare a multi-argument block?
  I.e. given
  blahMethod: withArg SpecialBlock: myBlock = (
		myBlock value: 10 Value: 20.

  I want to call it with:

  blahMethod: myArg SpecialBlock: [ | :firstArg :secondArg |
		" do neat things with the arguments "

  Actually, I haven't written the body of the blahMethod: yet.
  I am getting syntax errors on the call...
  It is possible that a redesign would get rid of this problem, but
I doubt it, since I want to have a generic function that does something
intelligent to a property of a sub-object. Specifically, it expands
or contracts one of the dimensions, the dimension being changed 
should be specified by the *enclosing* object, and *changes* 
for one case (the y dimension has an up from baseline and down
from baseline component). 
  Maybe I'm just too much of a LISP hacker :-)

  Also, I created an object that I call a `boundedNum' that I use
for the dimensions. It is an integer that can grow (shrink) to a certain
maximum (minimum) size, but no greater (smaller). Some boundedNum's 
have only one bound, or zero bounds --- i.e. one of the bounds is
infinity. I was pleased to type `infinity' and have it work. I 
tried -infinity, but that got Self 1.3 upset. Okay, negInfinity:
0 - infinity, and it is happy. (it even prints as "-Inf") However,
once I've create negInfinity, any subsequent code loaded fails.
Does this happen with 2.0/2.1, or is this particular to my 


p.s: I have done too much work under 1.3 to switch to 2.0 at this
junction. Probably later. R James Noble's X stuff works quite well.
I understand that the 2.0 X stuff uses bitmaps?