Codebase list ohcount / c941801a-846c-49c1-93c4-07f1094d7537/main test / src_dir / factor1.factor
c941801a-846c-49c1-93c4-07f1094d7537/main

Tree @c941801a-846c-49c1-93c4-07f1094d7537/main (Download .tar.gz)

factor1.factor @c941801a-846c-49c1-93c4-07f1094d7537/mainraw · history · blame

! This is a comment
! Factor syntax is very simple, it just contains words separated by spaces
! '!' is a line comment word
! "whatever" is a string word
USING: kernel io ; ! This is a vocabulary inclusion word
IN: testing

: test-string ( -- )
  "this is a string" print ;

: test ( x -- y ) ! Parenthesis define a stack effect declaration
  dup swap drop ;

MAIN: test