sample defun with return

Discussion of Common Lisp

sample defun with return

Postby rodrigo_sjc_sp » Tue Oct 02, 2012 12:59 pm

I need a sample code Lisp .

A function(defun) returning value

A simple example

Posts: 3
Joined: Mon Oct 01, 2012 6:26 am

Re: sample defun with return

Postby Goheeca » Tue Oct 02, 2012 1:26 pm

The internet is full of that.
Code: Select all
(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.
User avatar
Posts: 271
Joined: Thu May 10, 2012 12:54 pm

Re: sample defun with return

Postby nuntius » Tue Oct 02, 2012 7:32 pm

Please see one of the useful resources in the FAQ.
User avatar
Posts: 532
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: sample defun with return

Postby sylwester » Wed Oct 03, 2012 4:38 am

Code: Select all
(defun return-a-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
Posts: 130
Joined: Mon Jul 11, 2011 2:53 pm

Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 4 guests