Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Empty-string/Nyquist/empty-string-1.nyquist
Normal file
13
Task/Empty-string/Nyquist/empty-string-1.nyquist
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(setf emptystring "") ;binds variable'emptystring' to the empty string ""
|
||||
|
||||
(let ((emptystring "")) ;; Binds local variable 'emptystring' to the empty string ""
|
||||
(when (string-equal emptystring "") ;;case insensitive string comparison
|
||||
(print "Is an empty string")) ;;bad argument error if not a string
|
||||
(when (stringp emptystring)
|
||||
(print "Is a string"))
|
||||
(when (not (stringp emptystring))
|
||||
(print "Is not a string"))
|
||||
(when (and (stringp emptystring)(= (length emptystring) 0))
|
||||
(print "Is an empty string"))
|
||||
(when (and (stringp emptystring)(> (length emptystring) 0))
|
||||
(print "Is a non-empty string")))
|
||||
6
Task/Empty-string/Nyquist/empty-string-2.nyquist
Normal file
6
Task/Empty-string/Nyquist/empty-string-2.nyquist
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
define variable emptystring = "" ;binds variable'emptystring' to the empty string ""
|
||||
|
||||
if emptystring = "" then
|
||||
print "is empty string"
|
||||
else
|
||||
print "is not empty string"
|
||||
10
Task/Empty-string/Nyquist/empty-string-3.nyquist
Normal file
10
Task/Empty-string/Nyquist/empty-string-3.nyquist
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
;nyquist plug-in
|
||||
;version 4
|
||||
;type tool
|
||||
;name "Empty string"
|
||||
|
||||
(setq emptystring "") ;; Define global variable
|
||||
|
||||
(if (string= emptystring "") ;;case sensitive string comparison
|
||||
"The string is empty."
|
||||
"The string is not empty.")
|
||||
12
Task/Empty-string/Nyquist/empty-string-4.nyquist
Normal file
12
Task/Empty-string/Nyquist/empty-string-4.nyquist
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
;nyquist plug-in
|
||||
;version 4
|
||||
;codetype sal
|
||||
;type tool
|
||||
;name "Empty string"
|
||||
|
||||
define variable emptystring = "a" ;; Define global variable
|
||||
|
||||
;; The ternary operator is #?
|
||||
return #?(emptystring = "",
|
||||
"The string is empty.",
|
||||
"The string is not empty.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue