On Sunday 11 December 2011 19:32:53 Manlio Perillo wrote: > Scusa, ma di cosa vi scandalizzate? > Anche Common Lisp lo permette, almeno 10 anni prima di PHP: > > $clisp -q -norc > [1]> (setf (fdefinition 'read-string) (get-macro-character #\")) > #<SYSTEM-FUNCTION SYSTEM::STRING-READER> > [2]> > (set-macro-character #\" > #'(lambda (stream char) > (let* ((buf (read-string stream char)) > (n (parse-integer buf :junk-allowed t))) > n))) > T > [3]> (+ "3viso" 2) > 5
Non conosco LISP (è nalla mia todo list), però così non vale! Utilizzando in maniera interattiva l'interprete Python si può ottenere lo stesso risultato con sys.displayhook. :P -- Daniele Tricoli 'Eriol' http://mornie.org _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python