On 10/4/18 9:37 AM, Brandon Allbery wrote:
Consider a function which returns the element at a given position in a list:

     method AT-POS(\position)

The only thing you can say about the result type is that it's whatever the type of the element at that position is. So it doesn't bother specifying a type at all, because the prototype can't know ahead of time what lists you might use it on contain. If you need to know, you can smartmatch the type of the returned value afterward or use the .^can MOP method to see if it supports a named method, etc.

(The \ in there means it's a raw value, for speed; AT-POS, as suggested by being all uppercase, is used internally for a bunch of things and wants to be as fast as possible, so it's using some internal tricks.)

Hi Brandon,

Thank you for the nice description.

As I told Peter, I think I am demanding too much from the routine
line.  I do believe that there should be a required written
description of "what" the routine does to give me the "what"
is returned.

I think the misunderstanding is that when I say "what" others are hearing "what type". What I mean by "what" is "what information".

My fault for not making myself more clear.

-T

Reply via email to