我设计并实现了一种编程语言。
这种语言的特点之一是将函数(在示例代码中,我称之为leftBind)伪装成一个变量,这样任何以下的点符号都可以作为标识符传递。
编辑:这也类似于类的访问器方法,除了这里没有使用类。相同的术语“getter”或“accessor”在这里适用吗?
这种语言的目的是提供一个功能齐全的语言但被监禁的环境,以允许项目的复杂配置,但保护项目免受整个未经授权的行为。
一个例子:
/*leftbind aliases the identifier “sql” to the function “quote”
It is called leftBind, since it’s binding the left side of the parse tree to a function*/
leftBind(“sql”, “quote”);
q=“select * from foo where user=$sql.user”; // equivalent to quote(user)
这对于更复杂的任务或当您想要将常用函数内联到字符串中而不需要额外的代码行乱扔您的程序时变得非常方便。
这种行为的术语是什么?