Re: [j-nsp] negation operator in SLAX

2018-07-03 Thread Phil Shafer
Timur Maryin writes: >On 18-Jun-18 20:40, Phil Shafer wrote: >> "!" and "not" are identical. The "!" is just syntactic sugar that >> turns "! x " into "not(x)", as you can see in the code: >Was it always like this? Yup. SLAX is all about syntactic sugar. Well, mostly, anyway. There are extensio

Re: [j-nsp] negation operator in SLAX

2018-07-03 Thread Timur Maryin via juniper-nsp
Hi Phil, On 18-Jun-18 20:40, Phil Shafer wrote: "!" and "not" are identical. The "!" is just syntactic sugar that turns "! x " into "not(x)", as you can see in the code: Was it always like this? ___ juniper-nsp mailing list juniper-nsp@puck.neth

Re: [j-nsp] negation operator in SLAX

2018-06-19 Thread Martin T
On Mon, Jun 18, 2018 at 9:40 PM Phil Shafer wrote: > > Martin T writes: > >Oh, yes. I forgot the not() function. I made a small comparison > >between not(), jcs:empty() and ! using five data types in SLAX: > > "!" and "not" are identical. The "!" is just syntactic sugar that > turns "! x " into "

Re: [j-nsp] negation operator in SLAX

2018-06-19 Thread Phil Shafer
Martin T writes: >Oh, yes. I forgot the not() function. I made a small comparison >between not(), jcs:empty() and ! using five data types in SLAX: "!" and "not" are identical. The "!" is just syntactic sugar that turns "! x " into "not(x)", as you can see in the code: https://github.com/Juniper/

Re: [j-nsp] negation operator in SLAX

2018-06-16 Thread Martin T
Hi! > There is not() : Oh, yes. I forgot the not() function. I made a small comparison between not(), jcs:empty() and ! using five data types in SLAX: 1) False boolean value: As expected "not( $boolean )" returns true. Also, the "jcs:empty( $boolean )" returns true because jcs:empty() always co

Re: [j-nsp] negation operator in SLAX

2018-06-15 Thread Timur Maryin via juniper-nsp
Hi Martin, There is not() : https://www.juniper.net/documentation/en_US/junos/topics/reference/scripting/junos-script-automation-function-xslt-not.html On 14-Jun-18 23:39, Martin T wrote: Hi! I have quite often used "!" negation operator familiar from other languages. For example: /* If

[j-nsp] negation operator in SLAX

2018-06-14 Thread Martin T
Hi! I have quite often used "!" negation operator familiar from other languages. For example: /* If string does not match the pattern, then terminate the script. */ if ( ! jcs:regex( $pattern, $string ) ) { terminate 'Invalid input string!'; } However, I have not found this method in the of