Top 1,000 Features Creators Resources Blog Explore Download
GitHub icon

hasUserDefinedOperators

< >
Example from HOPE:
Hope enables us to use a function with two arguments as an infix operator. e must assign it a priority and use it as an infix operator everywhere, including the equations that define it. A bigger number in the infix declaration means a higher priority. Most of Hope's standard functions are supplied as infix operators. infix mult 8; dec mult : num # num - > num; ---xmulty<= ifY=0then0elsexmult(y-1)+x;
Example from Speedie:
class myclass |int| Num operator add (|int| x, |myclass|) return myclass(.num + x) render fs <~ .num main || x = myclass(1) || y = myclass(2) || z = y + x printline z

Languages with hasUserDefinedOperators include HOPE, Speedie

Languages without hasUserDefinedOperators include C3, Jule

HTML of this page generated by Features.ts

View source

- Build the next great programming language About Acknowledgements Extensions Day 624 feedback@pldb.io