File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 127127 );foreach mapcan
128128 ));let ;fun
129129
130- (defglobalfun _\@fun ( name args doc global strict out body )
130+ (defglobalfun _\@fun ( name args doc global memoize strict out body )
131131 "`@fun ' helper, generates S-expression to define a valid SKILL function."
132132 (assert doc "@fun - when defining '%N' ?doc is required and should be a string: %N" name doc)
133133 (let ( ( lambda_sexp
139139 body)
140140 ) )
141141 )
142+ (when memoize (setq lambda_sexp `(@memoize ,lambda_sexp)))
142143 `( prog1
143144 (define ,name ,lambda_sexp)
144145 ,@(when global `( ( when (theEnvironment) ( putd ',name ,name) ) ))
@@ -292,23 +293,25 @@ Raise an error otherwise."
292293 @key
293294 doc
294295 global
296+ memoize
295297 ( strict (equal "TRUE" (getShellEnvVar "SKILL_SHARP_STRICT_TYPE_CHECKING")) )
296298 ( out '__undefined__ )
297299 @rest body )
298300 "TODO - `@fun ' implementation is still a draft..."
299- (_\@fun name args doc global strict out body))
301+ (_\@fun name args doc global memoize strict out body))
300302
301303(@macro @proc ( name_and_args
302304 @key
303305 doc
304306 global
307+ memoize
305308 ( strict (equal "TRUE" (getShellEnvVar "SKILL_SHARP_STRICT_TYPE_CHECKING")) )
306309 ( out '__undefined__ )
307310 @rest body )
308311 "This macro allows C-style writing.
309312`@proc ' is only `@fun ' wrapper (like `procedure' for `defun' or `globalProc' for `defglobalfun').
310313Please refer to `@fun ' documentation."
311- (_\@fun (car name_and_args) (cdr name_and_args) doc global strict out body)
314+ (_\@fun (car name_and_args) (cdr name_and_args) doc global memoize strict out body)
312315 )
313316
314317;*/
You can’t perform that action at this time.
0 commit comments