Separate Namespaces for Functions and Variables in Common Lisp versus Scheme

The two different approaches have names: Lisp-1 and Lisp-2. A Lisp-1 has a single namespace for both variables and functions (as in Scheme) while a Lisp-2 has separate namespaces for variables and functions (as in Common Lisp). I mention this because you may not be aware of the terminology since you didn’t refer to it … Read more

SASS ignores variables, defined in if-statement

That’s completely expected. Variables have a scope to them. If you define them inside of a control block (like an if statement), then they won’t be available outside. So, what you need to do is initialize it outside like so: $text-color: null; $background-color: null; @if $colorscheme == white { $text-color: #333; $background-color: #fff; } @else … Read more

Awk print string with variables

printf allows interpolation of variables. With this as the test file: $ cat file a,b,APPLE,d,MANGO,f We can use printf to achieve the output you want as follows: $ awk -F, ‘{printf “/p/%s_abc/xyz/%s_abc_def/\n”,$3,$5;}’ file /p/APPLE_abc/xyz/MANGO_abc_def/ In printf, the string %s means insert-a-variable-here-as-a-string. We have two occurrences of %s, one for $3 and one for $5.

Using variables in a vim shell command

Use the execute command. Everything after it is an expression that evaluates to a string, which it then executes like a command you had typed in yourself. function Ls(dir) execute ‘!ls ‘ . a:dir endfunction This says, “Evaluate the expression ‘!ls ‘ . a:dir and then execute it.” The variable a:dir is expanded, the dot … Read more

tech