Questions tagged [colon-equals]

For questions regarding the `:=` operator available in several languages

60 questions
26
votes
7 answers

What is the := operator?

In some programming languages, I see (ex.): x := y What is this := operator generally called and what does it do?
Cole Tobin
  • 9,206
  • 15
  • 49
  • 74
25
votes
2 answers

Why is := allowed as an infix operator?

I have come across the popular data.table package and one thing in particular intrigued me. It has an in-place assignment operator := This is not defined in base R. In fact if you didn't load the data.table package, it would have raised an error…
xiaodai
  • 14,889
  • 18
  • 76
  • 140
24
votes
4 answers

What is the difference between = and := in MySQL?

What is the difference in between set test_var = 20; and set test_var:=20; as they both seem to assign the value ?
hsuk
  • 6,770
  • 13
  • 50
  • 80
19
votes
7 answers

What does := mean in Go?

I'm following this tutorial, specifically exercise 8: http://tour.golang.org/#8 package main import "fmt" func swap(x, y string) (string, string) { return y, x } func main() { a, b := swap("hello", "world") fmt.Println(a,…
sergserg
  • 21,716
  • 41
  • 129
  • 182
17
votes
2 answers

What does := mean in vb.net?

We have this method call: SendAck(AppData:=AppData, Status:=Status, StatusMessage:=StatusMessage, IsApplication:=IsApplication) And here is the definition: Private Sub SendAck(ByVal AppData As XDocument, ByVal Status As Boolean, ByVal StatusMessage…
Scott
  • 2,143
  • 2
  • 19
  • 25
16
votes
3 answers

What's the difference between :- and := in Bash parameter substitution?

What's the difference between :- and := in Bash parameter substitution? They seem to both set the default?
Casebash
  • 114,675
  • 90
  • 247
  • 350
14
votes
1 answer

colons equals operator in R? new syntax?

While reading http://ggvis.rstudio.com/interactivity.html, I noticed the code has := sprinkled in it. I assume that is a new way of providing arguments to a function? What is it exactly? mtcars %>% ggvis(~wt, ~mpg, size := input_slider(10,…
Chris
  • 1,219
  • 2
  • 11
  • 21
14
votes
3 answers

What is the " := " operator in (VB).NET or what is it good for?

I see this from time to time and want to know what it is. I did try google, but its filtering out the characters from the search. I have a few books that don't reference it either. FWIW, I remember in pascal that is was the assignment operator.…
StingyJack
  • 19,041
  • 10
  • 63
  • 122
14
votes
2 answers

R data.table ':=' works in direct call, but same function in a package fails

Using R's data.table package, This works: instruction = "a = data.table(name=1:3, value=1:3, blah=1:3); a[,c('value', 'blah'):=NULL]" eval(parse(text=instruction)) # name #1: 1 #2: 2 #3: 3 This works: myFunc = function(instruction)…
nsheff
  • 3,063
  • 2
  • 24
  • 29
14
votes
3 answers

What' s the difference between <= and := in VHDL

Currently, I am learning some FPGA design techniques using VHDL, my problem is whether we can use := and <= interchangeably in VHDL or not, though I've seen the use of := in constants declarations and <= in assignments? Thanks in advance!
Jivan
  • 1,300
  • 6
  • 21
  • 33
12
votes
1 answer

what does this symbol mean := in sql

What does this mean := in sql ? If found some sql using like that symbol example select col1, col2, @pv:=col3 as 'col3' from table1 join (select @pv:=1)tmp where col1=@pv
ashTon
  • 1,101
  • 4
  • 14
  • 23
12
votes
4 answers

What does ":=" mean in Pseudocode?

Really basic syntax question in pseudocode. What does := mean in Pseudocode?Example a := 1
ElectronAnt
  • 2,115
  • 7
  • 22
  • 39
10
votes
4 answers

What does a := (colon equals) in VB.NET do?

Possible Duplicate: What is the use of the := syntax? I've tried hunting down the MDSN documentation for := in VB.NET as well as scoured Google only to be linked to a dead MSDN page... What would the purpose of := be?
Andy Danger Gagne
  • 2,107
  • 1
  • 17
  • 26
10
votes
1 answer

delphi object assign vs :=

Could someone explain the difference between: (1.) newObj := TMyObject.Create; newObj.Assign(oldObj); and (2.) newObj := oldObj; in 2. does newObj and oldObj refer to the same single object? Sorry if this has been covered before but is is…
Dinesh M
  • 183
  • 2
  • 8
10
votes
4 answers

What does operator ':=' mean?

I am trying to compile pthreads for MSVC2015 and found some strange code. localPtr->wNodePtr->spin := PTW32_TRUE; What is this line doing?
none7
  • 103
  • 1
  • 5