Yes. Stabel is staticly typed, and types are inferred if the type signature is left out. You could also write the code as:
def: cube
type: Int -- Int
: dup dup * * def: cube
type: Int -- Int
: dup dup * *I just like to minimize exceptions to rules and this seems a weird one to me. But probably has reasons I am unaware of (besides subjective readability which is, of course a very good reason).
[0] https://gist.github.com/tluyben/16ee2645c4c8aed813005d51488d...
[ dup + ] \ writes a lambda function to heap and push ptr
: double ; \ : writes the next symbol as a string to heap and push ptr
\ ; is define, writes definition into dict
The reason Forth did it the classic Forth way originally, I suspect, is because Forth's parser needs to be told to switch modes. Stop executing words directly and start compiling them. There isn't really anywhere to store a temporary string, so you need to tell it to start writing into the dictionary entry before you give it the string. In my language, using [ ] for quotations starts writing to the heap, which is also where strings go. This has the same practical effect.Stabel allows you to define structs and unions, which gives you a lot of flexibility.
Not sure. Ad-hoc polymorphism is currently in the design-phase and I'm looking at many possible solutions. But before I get to that point I still have a lot of stuff to implement first.