Skip to content

carlosmorette/tony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Tony

TODO: Add description

Installation

If available in Hex, the package can be installed by adding tony to your list of dependencies in mix.exs:

def deps do
  [
    {:tony, "~> 0.1.0"}
  ]
end
(defproc (sum a b)
  (+ a b))

(print (sum 9 44))

(defproc (checklanguage name)
   (if (== name "Tony")
       "My Own LISP"
       "Another language"))

(print (checklanguage "Tony")) ;; My Own LISP


;; Lambda

(defproc (mult-lambda-version a b callback)
    (callback (* a b)))

(mult-lambda-version 2 3 (lambda (r) (print r))) ;; 6

((lambda (x) (print x)) "That's works!") ;; That's works!

;; Recursion
(defproc (reduce-sum lst acc)
       (if (empty? lst)
         acc
		 (reduce-sum
			 (tail lst)
			 (+ acc (head lst)))))

(print (reduce-sum (list 54 67 89) 0)) ;; 210

;; Libraries

;; Using imports
;; Available libs File and Regex
(import "file" "regex")

;; ([librarie]:[function] [params...])
(print (file:read "mix.exs")) ;; mix.exs content

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/tony.

About

๐Ÿ’œ | My Own programming language (LISP)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages