Change an argument in kakoune - kakoune

Is there any easy way to select/change/delete an argument in kakoune?
For example, if I have
int foo(int arg1, int arg2)
and I would like to select int arg1. In spacemacs I can do this with via. How do I do this in kakoune?

You can use the u text-object.
So, while inside the parens type <a-i>u.
If you do <a-a>u instead, it will also select the following comma and space.

Related

How do I concatenate raw bits/hex values onto a String in Fortran?

I want to do something like this (C sample):
char str[] = "Hello\x90\x90\xcc\x00";
How?
The equivalent of this in Fortran would be:
character(*), parameter :: str = "Hello"//char(144)//char(144)//char(204)//char(0)
I made this a named (PARAMETER) constant here, but the expression for initializing would be the same in a normal assignment context. Standard Fortran doesn't allow the use of hex constants (such as Z'90') as an argument to CHAR, though many compilers support that as an extension.

int execle(const char *path, const char *arg, ..., char * const envp[]);

int execle(const char *path, const char *arg, ..., char * const envp[]);
In the prototype of function above used in Linux, after variable arguments, they used named variable which is not possible in C language.
Because in C language in variadic function after variable argument we can not pass named argument then why in function given above they used named argument after variable argument (...).
The final argument is technically part of the variable argument list (...). It is just shown to provide the type and a name for the final argument, to make the documentation easier to understand. The current version of the manual page shows this argument in a comment to match the actual C prototype.

how to use a variable in parameters

i need to know how to use a variable in parameters
PROCESS is initalized as
string PROCESS in the class parameters.
Process::GetProcessesByName("")
which gives me an error when i replace the string with a variable
Process::GetProcessesByName(PROCESS)
The error i get back is:
No instance of overloaded function "System::Diagnostics::Process::GetProcessByName" Matches the argument list argument types are (std::string)
I think GetProcessesByName may take a parameter as LPSTR or char const *, but not a std::string,
try use
Process::GetProcessesByName(PROCESS.c_str());
or if your PROCESS is defined as std::string PROCESS;,
String^ process_name = gcnew String(PROCESS.c_str());
Process::GetProcessesByName(process_name);

Unknown pointer notification

I've got some difficulties to understand the following declaration in VC++:
int numChoice=figureCB->SelectedIndex;//CB=COMBO BOX
char Choice=((String^) figureCB->Items[numChoice])[0];//
It's the second line that causes me the problem. Why is 'String^' in brackets?
Why is:
char Choice=(String^ figureCB->Items[numChoice])[0];//
uncorrect?
Usually, when I declare a pointer on a class, I write:
ClassName *pointername;
or, when it points to a managed class:
ClassName ^pointername;
This is CLI code, not pure C++, (what you have called 'managed').
The brackets are a cast.

What (are there any) languages with only pass-by-reference?

I was wondering. Are there languages that use only pass-by-reference as their eval strategy?
I don't know what an "eval strategy" is, but Perl subroutine calls are pass-by-reference only.
sub change {
$_[0] = 10;
}
$x = 5;
change($x);
print $x; # prints "10"
change(0); # raises "Modification of a read-only value attempted" error
VB (pre .net), VBA & VBS default to ByRef although it can be overriden when calling/defining the sub or function.
FORTRAN does; well, preceding such concepts as pass-by-reference, one should probably say that it uses pass-by-address; a FORTRAN function like:
INTEGER FUNCTION MULTIPLY_TWO_INTS(A, B)
INTEGER A, B
MULTIPLY_BY_TWO_INTS = A * B
RETURN
will have a C-style prototype of:
extern int MULTIPLY_TWO_INTS(int *A, int *B);
and you could call it via something like:
int result, a = 1, b = 100;
result = MULTIPLY_TWO_INTS(&a, &b);
Another example are languages that do not know function arguments as such but use stacks. An example would be Forth and its derivatives, where a function can change the variable space (stack) in whichever way it wants, modifying existing elements as well as adding/removing elements. "prototype comments" in Forth usually look something like
(argument list -- return value list)
and that means the function takes/processes a certain, not necessarily constant, number of arguments and returns, again, not necessarily a constant, number of elements. I.e. you can have a function that takes a number N as argument and returns N elements - preallocating an array, if you so like.
How about Brainfuck?

Resources