Is it possible to implement a Ruby-like internal DSL in Python?

Is it possible to implement internal DSL in a language without macros? Has anyone succeeded in implementing a Ruby-like internal DSL in python?

I am trying to create a simple state machine with a more intuitive syntax like:

start -> Event -> Next ->Action 
+3
source share
1 answer

I am having problems resolving the issue.

AFAIU, you ask

Can you implement a Ruby-like internal DSL in a macro-free language?

And the answer to this is obviously โ€œYes,โ€ since Ruby has no macros.

+1
source

Source: https://habr.com/ru/post/1776788/


All Articles