This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

sample defun with return

4 posts · 4952 views

I need a sample code Lisp .

A function(defun) returning value

A simple example


Thanks
Rodrigo

Re: sample defun with return

The internet is full of that.
Anyway:
(defun value-returner () 'value)
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.

Re: sample defun with return

Please see one of the useful resources in the FAQ.

Re: sample defun with return

(defun return-a-value (return-value)
           return-value)

(return-a-value 'test) ==> test
(return-a-value (* 3 6)) ===> 18
I'm the author of two useless languages that uses BF as target machine.
Currently I'm planning a Scheme compiler :p