Note that there are some explanatory texts on larger screens.

plurals
  1. POCan you add new statements to Python's syntax?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COOn a somewhat related note, one use-case where it could be handy to create new statements on the fly (as opposed to seriously "extending" the language) is for people who use the interactive interpreter as a calculator, or even an OS shell. I often create little throwaway functions on the fly to do something I'm going to repeat, and in those situations would be nice to create very abbreviated commands like macros or statements rather than typing the long names with function() syntax. Of course that's not really what Py is for.. but people do spend a lot of time using it interactively.
      singulars
    2. CO@Kilo it might be worth looking at ipython - it has a lot of shell'ish features, for example you can use regular "ls" and "cd" commands, tab-completion, lots of macro-ish features etc
      singulars
    3. COSome languages are exquisitely extensible, e.g. Forth and Smalltalk, but their language paradigms are different than that used by Python as well. With both of those any new words (Forth) or methods (Smalltalk) become an integral, indistiguishable part of the language for that installation. So each Forth or Smalltalk installation becomes a unique creation over time. Also Forth is RPN based. But thinking along the lines of DSLs, something like this should be accomplishable in Python. Though, as others have said here, why?
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload