0Pricing
Mojo Academy · Ders

Aktarım İşleci

Değerleri ^ simgesiyle taşıyın.

Aktarım İşleci, CoddyKit'te ücretsiz bir Mojo Academy dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Mojo Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Mojo Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Move, Don't Copy

Passing to an owned parameter usually makes a copy. But if you are done with the original, copying is wasteful. You can move it instead. 🚚

Meet the Transfer Operator

Mojo's transfer operator is the caret ^ sigil. You place it after a value to hand its ownership over instead of duplicating it.

Using It in a Call

Add ^ when calling a function with an owned parameter. The value transfers in, and no copy is made.

var msg = String("hi")
consume(msg^)

The Original Is Gone

After a transfer, the source variable is no longer valid. Mojo ends its lifetime, so you cannot accidentally use the moved value.

The Compiler Enforces It

Try to read a variable after moving it and the compiler rejects your code. This check stops use-after-move bugs before they run.

Why Moving Is Faster

A move just transfers ownership of the existing data. There is no deep copy, which matters a lot for big strings, lists, or buffers.

Copy or Move, Your Choice

Without ^ Mojo copies into an owned parameter; with ^ it moves. You decide based on whether you still need the original.

Transfer on Assignment

The caret also works between variables. Writing one var from another with ^ moves the value rather than copying it across.

var a = String("data")
var b = a^  # a is now invalid

Pairs With owned

The transfer operator is the natural partner of owned parameters. Together they express giving a value away cleanly and cheaply.

Safety Plus Speed

Moves give you C-like efficiency while the compiler guarantees you never touch a value after handing it off. That is safe and fast.

The Full Ownership Picture

borrowed, inout, owned, and the ^ transfer together let you control exactly how data flows through your program, with no surprises.

Quick Check

Let us check what the ^ operator does to the source.

Recap

The ^ transfer operator moves a value instead of copying it, ending the source's life. Paired with owned, it makes giving data away fast and safe. 🎯

Sıkça Sorulan Sorular

“Aktarım İşleci” dersi ücretsiz mi?

Evet — “Aktarım İşleci” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Mojo Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Mojo Academy kursu toplamda 4 dersten oluşur.

“Aktarım İşleci” dersinde ne öğreneceğim?

Değerleri ^ simgesiyle taşıyın. Mojo Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Mojo Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Mojo Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.

“Aktarım İşleci” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Mojo Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Mojo Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Bağımsız Değişkenleri Salt Okunur Ödünç Alma
  2. inout ile Yerinde Değiştirme
  3. owned ile Sahiplik Alma
  4. Aktarım İşleci
← Mojo Academy Sayfasına Dön