Search found 6 matches

by borisT
Mon Apr 03, 2023 1:18 pm
Forum: newLISP in the real world
Topic: return value in a function
Replies: 4
Views: 481

Re: return value in a function

The use case I am thinking of is one you often get in GUIs where a handle is returned by e.g. a button create function and then further calls are made with that handle before returning the handle to the caller. In that use case simply referring to the handle at the end of the function works well Tha...
by borisT
Mon Apr 03, 2023 9:38 am
Forum: newLISP in the real world
Topic: return value in a function
Replies: 4
Views: 481

Re: return value in a function

Thanks for that, my brain wasn't working! I get it now - use an identity function

Code: Select all

(define (return x) x)

define (foo ..) (
	(setq x (func1...)
	(func2 ....)
	(return x))
by borisT
Sun Apr 02, 2023 10:59 pm
Forum: newLISP in the real world
Topic: return value in a function
Replies: 4
Views: 481

return value in a function

I know functions return the result of the last operation
But is there a way to return a value which is not the result of the last operation in a function
.e.g.

Code: Select all

(define (foo)
  (somefunc1...) ; Want to return the result of this function
  (somefunc2...))
by borisT
Tue Mar 14, 2023 10:53 pm
Forum: newLISP newS
Topic: I'd like to offer to take over these forums
Replies: 25
Views: 3310

Re: I'd like to offer to take over these forums

I'm happy to vote for that
by borisT
Thu Jan 31, 2019 8:39 am
Forum: newLISP in the real world
Topic: list of functions question
Replies: 3
Views: 3348

Re: list of functions question

Makes sense. Thanks for that.
by borisT
Wed Jan 30, 2019 3:45 pm
Forum: newLISP in the real world
Topic: list of functions question
Replies: 3
Views: 3348

list of functions question

I'm a newbie, I'm trying to write some code that will select and run a function from a list of functions Typically I'm doing something like this: (define (myfunc) (println "this is myfunc")) ;; define a list of functions (set 'funclist '(myfunc myfunc myfunc myfunc myfunc)) ;; get and run the nth = ...