Programming-Idioms

Implementation
Rust

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Implementation edit is for fixing errors and enhancing with metadata.

Instead of changing the code of the snippet, consider creating another Rust implementation.

Other implementations
mainloop:
	for _, v := range a {
		for _, w := range b {
			if v == w {
				continue mainloop
			}
		}
		fmt.Println(v)
	}
mainloop: for(int v:a){
	for(int w:b){
		if(v==w)
			continue mainloop;
	}
	System.out.println(v);
}
OUTER:
for my $v (@a) {
   for my $check (@b) {
      next OUTER if $v == $check;
   }
   print "$v not in the list\n";
}
      
OUTER:
for (var i in a) {
   for (var j in b) {
      continue OUTER if a[i] === b[j];
   }
   console.log(a[i] + " not in the list");
}
import std.stdio;
auto a = [1,2,3,4,5];
auto b = [3,5];

void main()
{
mainloop:
	foreach(v;  a){
		foreach(w; b){
			if(v == w) continue mainloop;
		}
		writeln(v);		 
	}
}
main()  {
  var a = [1, 2, 3];
  var b = [2, 3];

  outer: for (var v in a) {
    for (var w in b) {
      if (w == v) continue outer;
    }
    print(v);
  }
}
  for v in a do
    begin
      for  w in b do
        if (v = w) then
          break;
      if (v = w) then
        Continue;
      writeln(v);
    end;              
sequence_ [ print v | v <- a, [ u | u <- b, u == v] == [] ]
for v in a:
    try:
        for u in b:
            if v == u:
                raise Exception()
        print(v)
    except Exception:
        continue
a.each do |v|
  catch :matched do
    b.each do |u|
      throw :matched if v == u
    end
    puts v
  end  
end
$array_1 = [1,2,3,4,5];
$array_2 = [3,4];

foreach ($array_1 as $a) {
    foreach ($array_2 as $b) {
        if ($b == $a) {
            continue 2;
        }
    }
    echo $a
}
int *v = a;
while (v < a+N)
{
    int *w = b;
    while (w < b+M)
    {
        if (*v == *w)
            goto OUTER;
        
        ++w;
    }
    printf("%d\n", *v);
    
    OUTER: ++v;
}
#include <iostream>
auto a = {1,2,3,4,5};
auto b = {3,5};

for (auto va: a){
    for (auto vb: b){
        if (va==vb) goto OUTER;
    }
    std::cout << va << '\n';
    OUTER: continue;
}
  outer: do i=1,size(a)
     do j=1,size(b)
        if (a(i) == b(j)) cycle outer
     end do
     print *,a(i)
  end do outer
int[] alist = {1,2,3,4,5};
int[] blist = {3,4};
int gb = 0;
foreach (int a in alist)
{
  foreach (int b in blist)
  {
    gb = b;
    if (b == a)
      break;
  }
  if (gb == a)
    continue;
  System.Console.WriteLine(a);
}