http://qs321.pair.com?node_id=689378


in reply to Re^2: Half-serious quest for prefix anonymous refs taking
in thread Half-serious quest for prefix anonymous refs taking

The allusion to perl objects came more from the resemblance your dopen subroutine has to an object constructor plus my miscomprehension that you wanted to assign to an anonymous array. After rereading your post, I realize all you asking for was a indirect-object syntax for list constructors equivalent to the indirect-object syntax for list operators such as print and join. I still see similarities to perl objects, not in the Class and Package sense, but in that perl objects take arguments, possibly in indirect-object syntax, and return a reference. Only, in perl objects, the reference is blessed into a class which allows it to be used as a symbolic reference. Thus the symbol table reference.

Yes, if perl allows indirect-object syntax for list operators then it could allow the same for list constructors. However the syntax would have the same ambiguities. Who hasn't typed something like print ( $x - 1 ) / 2; and had to puzzle out why the parser dropped the last term? In the OP you mentioned nested anonymous assignments but the proposed syntax would not allow nested assignments due to the ambiguous syntax.

s/indirect-object/imperative/


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}