I'm quite puzzled by these, but especially floating constants. In all three cases the Rexx Ref says "If no ::CLASS directive precedes ::CONSTANT, a single constant method method is created that is not associated with a class but is accessible to the main (executable) part of a program through the .METHODS built-in object" substituting method or attribute as appropriate.
What exactly does "accessible" mean? It does not appear to be possible to access the value of a floating constant for example, nor assign a value to a floating attribute.
In fact, pretty much all I've been able to do is find out if floating attributes or methods are private, guarded or protected and get their source. I've not managed to access anything for a floating constant, apart from seeing it in the .Methods directory.
Re: Use of floating methods, attributes and constants
I also think this does not work as designed.
Using floating constants .methods is a string table of .method objects, indexed by the constant name, but in each case, the source attribute returns an array of zero lines.
Can anyone provide a code sample showing how to use this?
say '.Methods is a' .methods~class
do key over .methods
say key': constant =' .methods~at(key)~isConstant||', items =' .methods~at(key)~source~items||', value = ['.methods~at(key)~source~makestring']'
end /* DO */
::CONSTANT FIVE 5
::CONSTANT SIX 6
.Methods is a The StringTable class
SIX: constant = 1, items = 0, value = 
FIVE: constant = 1, items = 0, value =