Hacker News new | ask | show | jobs
by discreteevent 1746 days ago
This example helped me:

[r] > circle

  mul 2 3.14 r > perimeter

  mul 3.14 r r > area
The first line creates an “abstract” object named circle. It is abstract, because one of its attributes r is “free”. It’s not specified in this object and that’s why the object can’t be used as is, it has to be copied with r specified. For example, this is the circle c with the radius 30:

circle 30 > c

( Which would be like c=new circle(30) )

https://www.yegor256.com/2020/11/24/objects-without-methods....