Codebase list ohcount / 4fa67836-5fea-4473-87e4-bd80a2d5b1ae/main test / src_dir / factor1.factor
4fa67836-5fea-4473-87e4-bd80a2d5b1ae/main

Tree @4fa67836-5fea-4473-87e4-bd80a2d5b1ae/main (Download .tar.gz)

factor1.factor @4fa67836-5fea-4473-87e4-bd80a2d5b1ae/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