Share to: share facebook share twitter share wa share telegram print page

Affectation (informatique)

En algorithmique et en programmation informatique, une affectation, aussi appelée assignation par anglicisme, est une structure qui permet d'attribuer une valeur à une variable.

Il s'agit d'une structure particulièrement courante en programmation impérative, et dispose souvent pour cette raison d'une notation courte et infixée, comme x = expr ou x := expr. Dans certains langages, le symbole est considéré comme un opérateur d'affectation, et la structure entière peut alors être utilisée comme une expression. D'autres langages considèrent une affectation comme une instruction et ne permettent pas cet usage.

Notation

La structure d'affectation est le plus souvent notée x = expr ou x := expr.

x=expr (sans espace autour du caractère =) Tous les shell unix. Par exemple {Bourne shell, Bash}
x = expr Fortran, PL/I, C (et ses descendants comme C++, Java, etc.), Python, Go (pour des variables préalablement déclarées), R, haskell, etc.
x := expr ALGOL (et ses dérivés), Simula, CPL, BCPL, Pascal[1], PL/M, Ada, Smalltalk, Eiffel[2],[3], Oberon, Dylan[4], Go[5] (initialisation et déclaration simultanées) Io, ML[6], etc.

D'autres langages utilisent une notation en forme de flèche ou un mot-clé.

x <- expr F#, OCaml, R, S
x <<- expr R
assign("x", expr) R
x ← expr APL[7], Smalltalk
x =: expr J
let x = expr Rust
LET x = expr BASIC
let x := expr XQuery
set x to expr AppleScript
set x = expr C shell
Set-Variable x (expr) Windows PowerShell
x : expr Macsyma, Maxima, Rebol

Certains langages placent l'expression à gauche de l'opérateur, et l'identificateur à droite.

MOVE expr TO x COBOL
expr → x TI-Basic, Casio Basic
expr -> x R
put expr into x LiveCode

Certains langages, comme Lisp[8],[9] ou Tcl, utilisent une notation préfixée.

(setf x expr) Lisp
(set! x expr) Scheme[10],[11],[12]
set x expr Tcl
expr x ! Forth

Notes et références

  1. (en) Lawrie Moore, Foundations of Programming with Pascal, New York, John Wiley & Sons, (ISBN 0-470-26939-1)
  2. (en) Bertrand Meyer, Eiffel the Language, Hemel Hempstead, Prentice Hall International(UK), (ISBN 0-13-247925-7)
  3. (en) Richard Wiener, An Object-Oriented Introduction to Computer Science Using Eiffel, Upper Saddle River, New Jersey, Prentice Hall, (ISBN 0-13-183872-5)
  4. (en) Neal Feinberg, Keene, Sonya E., Mathews, Robert O. et Withington, P. Tucker, Dylan Programming, Massachusetts, Addison Wesley, (ISBN 0-201-47976-1)
  5. (en) The Go langage Specification: short variable declarations
  6. (en) Jeffrey D. Ullman, Elements of ML Programming: ML97 Edition, Englewood Cliffs, New Jersey, Prentice Hall, (ISBN 0-13-790387-1)
  7. (en) Kenneth E. Iverson, A langage, John Wiley and Sons, (ISBN 0-471-43014-5, lire en ligne)
  8. (en) Paul Graham, ANSI Common Lisp, New Jersey, Prentice Hall, (ISBN 0-13-370875-6)
  9. (en) Guy L. Steele, Common Lisp: The Language, Lexington, Digital Press, (ISBN 1-55558-041-6)
  10. (en) R. Kent Dybvig, The Scheme langage: ANSI Scheme, New Jersey, Prentice Hall, (ISBN 0-13-454646-6)
  11. (en) Jerry D. Smith, Introduction to Scheme, New Jersey, Prentice Hall, (ISBN 0-13-496712-7)
  12. (en) Harold Abelson, Sussman, Gerald Jay et Sussman, Julie, Structure and Interpretation of Computer Programs, New Jersey, McGraw-Hill, (ISBN 0-07-000484-6)
Read more information:

Sony Xperia XA2 Бренд SonyВиробник SonyСерія XperiaСумісні мережі GSM 850/1900 МГцWCDMA 900/2100LTE, EDGE, GPRSДата представлення 2018Попередник Sony Xperia XA2 UltraНаступник Sony Xperia 10Схожі моделі Sony Xperia XA2 Ultra, Sony Xperia XA2 PlusТип смартфонФормфактор моноблокРозміри 142 мм В70 мм Ш9,7 мм ТМаса 171 грамОпераційна система Поча

This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.Find sources: Fitchmoor, Illinois – news · newspapers · books · scholar · JSTOR (January 2023) Unincorporated community in Illinois, United StatesFitchmoor, IllinoisUnincorporated communityFitchmoorShow map of IllinoisFitchmoorShow map of the United StatesCoordinates:…

Roma 10Surat Roma 1:1-7 yang tertulis pada naskah Papirus 10, yang dibuat sekitar tahun 316 M.KitabSurat RomaKategoriSurat-surat PaulusBagian Alkitab KristenPerjanjian BaruUrutan dalamKitab Kristen6← pasal 9 pasal 11 → Roma 10 (disingkat Rom 10) adalah bagian Surat Paulus kepada Jemaat di Roma dalam Perjanjian Baru di Alkitab Kristen. Pengarangnya adalah Rasul Paulus, tetapi dituliskan oleh Tertius, seorang Kristen yang saat itu mendampingi Paulus.[1][2] Teks Naskah a…

Для термина «Эспиноса» см. также другие значения. Для термина «Энарес» см. также другие значения. МуниципалитетЭспиноса-де-ЭнаресEspinosa de Henares Герб 40°54′20″ с. ш. 3°04′14″ з. д.HGЯO Страна  Испания Автономное сообщество Кастилия — Ла-Манча Провинция Гвадалахара Глав…

BłażowaBłażowa   Comuna polonesa    Símbolos Brasão de armas Localização País  Polónia Voivodia Subcarpácia Powiat Rzeszowski Tipologia gmina urbana-rural Características geográficas Área total 112,7 km² População total (2004) 10 638 hab. Densidade 94,4 hab./km² Matrículas de automóveis RZE TERYT 3182416023 Sítio http://www.blazowa.itl.pl/index1.htm Błażowa (polaco: Gmina Błażowa) é uma gminy (comuna) na Polónia, na voivodia de Subcar…

Pemuda BalaikotaHalte Trans SemarangLetakKecamatanSemarang TengahKelurahanSekayuAlamatJl. Pemuda No. 143Informasi lainStatusBeroperasiDibuka18 September 2009 (2009-09-18)Direnovasi2020[1]Konstruksi dan FasilitasJenisHalte permanenPintu5 Pintu Kedatangan Pintu 1: Koridor VII dan VIII Pintu 2: Koridor IV dan V Pintu 3: Koridor II, III Pintu 4: Koridor I Petugas TiketAdaVending Machine TiketTersedia[2]PelayananAwal PelayananPukul 05.30 WIBAkhir PelayananPukul 17.40 WIBLayanan H…

Iliana Calabró Iliana Calabró en la Embajada de Italia en 2015Información personalNacimiento 1 de junio de 1966 (57 años)Buenos Aires, ArgentinaNacionalidad ArgentinaFamiliaPadres Aída Elena Picardi Juan Carlos CalabróCónyuge Fabián Rossi (1990-2012)Pareja Antonello Grandolfo (2015-2019)Hijos Nicolás Rossi (1994)Stéfano Rossi (1999)Familiares Marina Calabró (hermana)Información profesionalOcupación Actriz, comediante, vedette, cantante,Años activa desde 1978Obras notables Ilia…

Fresno mayoral election, 1996 ← 1992 March 26, 1996[1] 2000 →   Candidate Jim Patterson Michael Erin Woody Party Republican Nonpartisan Popular vote 36,281 24,531 Percentage 53.0% 35.8% Mayor before election Jim Patterson Republican Elected Mayor Jim Patterson Republican Elections in California Federal government U.S. President 1852 1856 1860 1864 1868 1872 1876 1880 1884 1888 1892 1896 1900 1904 1908 1912 1916 1920 1924 1928 1932 1936 1940 1944 1948 1952 …

Токмацький район адміністративно-територіальна одиниця Герб Прапор Колишній район на карті Запорізька область Основні дані Країна:  Україна Область: Запорізька область Код КОАТУУ: 2325200000 Утворений: 7 березня 1923 Ліквідований: 17 липня 2020 р. Населення: ▼ 20 988 (01.11.2020) Площа…

Al-Sa'adahPermukimanAl-Sa'adahLocation in the Kingdom of Saudi ArabiaKoordinat: 24°38′N 46°43′E / 24.633°N 46.717°E / 24.633; 46.717Koordinat: 24°38′N 46°43′E / 24.633°N 46.717°E / 24.633; 46.717Negara Arab SaudiPemerintahan • Gubernur Pangeran RiyadhFaisal bin Bandar Al Saud • Wali kotaIbraheem Mohammed Al-SultanKetinggian612 m (2,008 ft)Zona waktuUTC+3 (AST) • Musim panas …

For the album, see Friday on My Mind (album). For the television series, see Friday on My Mind (miniseries). 1966 single by The EasybeatsFriday on My MindCover of the 1966 Australian singleSingle by The Easybeatsfrom the album Good Friday B-sideMade My Bed, Gonna Lie in ItReleased 14 October 1966 (UK) 17 November 1966 (Australia) Recorded8 September 1966StudioIBC Studios, LondonGenre Garage rock[1] proto-punk[2] psychedelia[3] power pop[4] Length2:47LabelUnited Ar…

Penyuntingan Artikel oleh pengguna baru atau anonim untuk saat ini tidak diizinkan.Lihat kebijakan pelindungan dan log pelindungan untuk informasi selengkapnya. Jika Anda tidak dapat menyunting Artikel ini dan Anda ingin melakukannya, Anda dapat memohon permintaan penyuntingan, diskusikan perubahan yang ingin dilakukan di halaman pembicaraan, memohon untuk melepaskan pelindungan, masuk, atau buatlah sebuah akun. Kepolisian Negara Republik IndonesiaLogo Mabes PolriBendera Kepolisian Negara Republ…

Ethnic classification used in the 2011 United Kingdom Census This article is about one of the white ethnicity classifications used in the United Kingdom census. For the broad racial group, see white people in the United Kingdom. For the cattle breed, see British White. White BritishGeographic distribution of the White British in 2021 (in England and Wales)Total populationWhite British 49,997,686 (2011) (Excluding Northern Ireland)[1][2] Regions with significant populations U…

National coat of arms of the Republic of Croatia Coat of arms of CroatiaArmigerRepublic of CroatiaAdopted21 December 1990CrestA crown of five arms, as follows: Bleu Celeste a mullet of six points Or above a crescent argent; Azure two bars gules; Bleu Celeste three leopard heads caboshed Or; Azure a goat statant Or unguled and armed gules; Bleu Celeste on a fess gules fimbriated argent a marten Sable courant proper in chief a mullet of six points OrBlazonChequy of twenty-five gules and argent The…

  لمعانٍ أخرى، طالع جيمس جونسون (توضيح). هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (يوليو 2019) جيمس جونسون معلومات شخصية الميلاد سنة 1836  سيراليون  تاريخ الوفاة سنة 1917 (80–81 سنة)  مواطنة نيجيريا  الح…

Histórico de design do player de vídeo usado pelo YouTube. Observe que cada geração de layout pode ter passado por pequenas iterações não documentadas e que a aparência pode variar de acordo com os parâmetros de incorporação O YouTube é uma plataforma americana de compartilhamento de vídeos online com sede em San Bruno, na Califórnia, fundada por três ex-funcionários do PayPal – Chad Hurley, Steve Chen e Jawed Karim, em fevereiro de 2005. O Google comprou o site em novembro de …

Visvanatha Kanakasabhai PillaiBorn1855Died1906Occupation(s)Historian, lawyer Visvanatha Kanakasabhai Pillai (1855–1906) was an Indian lawyer, historian and Dravidologist of Sri Lankan Tamil descent. He was the first person to attempt a chronology of ancient Tamil Nadu. He was also one of the first people to deduce the references to a long-submerged legendary continent, Kumari Kandam, in texts such as Silappadhikkaram. Ancestry Kanakasabhai was born in Madras Presidency in 1855. His ancestors h…

This article is an orphan, as no other articles link to it. Please introduce links to this page from related articles; try the Find link tool for suggestions. (August 2015) Choi Byung Hoon (최병훈) (born 1952 in Kangwondo, South Korea) is a South Korean artist. He is considered by many to be the father of Contemporary Korean Design. Choi graduated from the Hong-ik University with a degree in applied fine arts in 1974, a few years later he completed his masters of fine arts from Hong-ik. Since…

Contemporary baidarka with sail Aleut men in Unalaska in 1896, with waterproof kayak gear and garments Three hatch model Aleut baidarka, by Sergie Sovoroff. Wooden frame of 1/6th scale model iqyax. The baidarka or Aleutian kayak (Aleut: iqyax) is a watercraft consisting of soft skin (artificial or natural) over a rigid space frame. Its initial design was created by the native Aleut (or Unangan) people of the Aleutian Islands. The Aleut people were surrounded by treacherous waters and required wa…

Public university in Democratic Republic of the Congo University of KinshasaUniversité de KinshasaMottoScientia Splendet et ConscientiaLatin: Science shines and so does conscienceTypePublicEstablished1954RectorJean-Marie Kayembe(since 2021)Academic staff1,929[1]Students29,554[1]LocationKinshasa, CongoColours    Red, yellow and blueWebsitewww.unikin.ac.cd The University of Kinshasa (French: Université de Kinshasa), commonly known as UNIKIN, is one of the three maj…

Kembali kehalaman sebelumnya

Lokasi Pengunjung: 54.90.167.73