Pretty much anything in parentheses can result in a callable object:

sage: R.<x,y> = QQ[]
sage: (x+y+1)(2,3)
6

Though we could check for tuples containing only integers, that is a 
reasonable regex. Though I'm a bit worried about the whole 
preparsing-with-regex approach. The more you layer on top there, the harder 
it becomes to maintain. At one point we should think about a real 
tokenizer/parser IMHO. Also there are a few extra caveats, the following 
are all legal Python:

(1, 2
  , 3)

(1, /
  2, 3)

(1, 2, # comment
  3)


On Wednesday, September 10, 2014 11:24:55 AM UTC+1, Dima Pasechnik wrote:
>
> How about going all the way and permit proper GAP-like syntax for 
> permutations? 
> That is, the preparser should replace 
> (1,2,3)(4,5)(7,8) with Permutation(['(1,2,3)','(4,5)','(7,8)']) 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to