SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
LDC 14/11/2011
3 clojures funcions
      Set - Rearrange


reset!
compare-and-set!
commute
user=> (doc reset!)
-------------------------
([atom newval])
  Sets the value of atom to newval without regard for the
current value. Returns newval.
compare-and-set!
-------------------------
([atom oldval newval])
  Atomically sets the value of atom to newval if and only if
the current value of the atom is identical to oldval. Returns
true if set happened, else false
commute
-------------------------
([ref fun & args])

  Must be called in a transaction. Sets the in-transaction-value of ref
to:
  (apply fun in-transaction-value-of-ref args)
  and returns the in-transaction-value of ref.
  At the commit point of the transaction, sets the value of ref to be:
  (apply fun most-recently-committed-value-of-ref args)
  Thus fun should be commutative, or, failing that, you must accept
  last-one-in-wins behavior. commute allows for more concurrency
than ref-set.
partition-*
Clojure Functions for Atomic Updates
Clojure Functions for Atomic Updates
Clojure Functions for Atomic Updates

Contenu connexe

Tendances

Testing Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitTesting Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitEric Wendelin
 
Taming Brownfield Codebases with AOP
Taming Brownfield Codebases with AOPTaming Brownfield Codebases with AOP
Taming Brownfield Codebases with AOPDonald Belcham
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
 
Austin Bingham. Transducers in Python. PyCon Belarus
Austin Bingham. Transducers in Python. PyCon BelarusAustin Bingham. Transducers in Python. PyCon Belarus
Austin Bingham. Transducers in Python. PyCon BelarusAlina Dolgikh
 
How to practice functional programming in react
How to practice functional programming in reactHow to practice functional programming in react
How to practice functional programming in reactNetta Bondy
 
The Power of Rails 2.3 Engines & Templates
The Power of Rails 2.3 Engines & TemplatesThe Power of Rails 2.3 Engines & Templates
The Power of Rails 2.3 Engines & TemplatesTse-Ching Ho
 
Real world scala
Real world scalaReal world scala
Real world scalalunfu zhong
 

Tendances (12)

Test Automation Using Googletest
Test Automation Using GoogletestTest Automation Using Googletest
Test Automation Using Googletest
 
Testing Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitTesting Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnit
 
Source Plugins
Source PluginsSource Plugins
Source Plugins
 
Durable Functions
Durable FunctionsDurable Functions
Durable Functions
 
Taming Brownfield Codebases with AOP
Taming Brownfield Codebases with AOPTaming Brownfield Codebases with AOP
Taming Brownfield Codebases with AOP
 
Array and functions
Array and functionsArray and functions
Array and functions
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
h-ubu : CDI in JavaScript
h-ubu : CDI in JavaScripth-ubu : CDI in JavaScript
h-ubu : CDI in JavaScript
 
Austin Bingham. Transducers in Python. PyCon Belarus
Austin Bingham. Transducers in Python. PyCon BelarusAustin Bingham. Transducers in Python. PyCon Belarus
Austin Bingham. Transducers in Python. PyCon Belarus
 
How to practice functional programming in react
How to practice functional programming in reactHow to practice functional programming in react
How to practice functional programming in react
 
The Power of Rails 2.3 Engines & Templates
The Power of Rails 2.3 Engines & TemplatesThe Power of Rails 2.3 Engines & Templates
The Power of Rails 2.3 Engines & Templates
 
Real world scala
Real world scalaReal world scala
Real world scala
 

En vedette

Ignoring Internet is Injurious to Medical Practice
Ignoring Internet is Injurious to Medical PracticeIgnoring Internet is Injurious to Medical Practice
Ignoring Internet is Injurious to Medical PracticeAditya Shah
 
魏权龄_数据包络分析法
魏权龄_数据包络分析法魏权龄_数据包络分析法
魏权龄_数据包络分析法kakaluv
 
Store accesory the best2
Store accesory the best2Store accesory the best2
Store accesory the best2lino
 
Facts about RBI Governer Raghuram Rajan
Facts about RBI Governer Raghuram RajanFacts about RBI Governer Raghuram Rajan
Facts about RBI Governer Raghuram RajanAditya Shah
 
HBK Heroes & Achievements
HBK Heroes & AchievementsHBK Heroes & Achievements
HBK Heroes & AchievementsAditya Shah
 
Orientation Day Presentation (Personalized Learning)
Orientation Day Presentation (Personalized Learning) Orientation Day Presentation (Personalized Learning)
Orientation Day Presentation (Personalized Learning) Aditya Shah
 
Wind Power Df Intro Uk
Wind Power Df Intro UkWind Power Df Intro Uk
Wind Power Df Intro Ukjanrud
 
Dosificación y jerarquización 2016 2017 (1)
Dosificación y jerarquización 2016 2017 (1)Dosificación y jerarquización 2016 2017 (1)
Dosificación y jerarquización 2016 2017 (1)IEEPO
 
Te amo-diapositivas
Te amo-diapositivasTe amo-diapositivas
Te amo-diapositivas214205
 
Coaching with the brain in mind
Coaching with the brain in mindCoaching with the brain in mind
Coaching with the brain in mindChristophe Marchal
 
Big data: Loading your data with flume and sqoop
Big data:  Loading your data with flume and sqoopBig data:  Loading your data with flume and sqoop
Big data: Loading your data with flume and sqoopChristophe Marchal
 
Exposicion sobre Vidrios
Exposicion sobre VidriosExposicion sobre Vidrios
Exposicion sobre VidriosDiego Garcia
 

En vedette (19)

Elis apresentacio cranio12
Elis apresentacio cranio12Elis apresentacio cranio12
Elis apresentacio cranio12
 
Os gi lightning talk
Os gi lightning talkOs gi lightning talk
Os gi lightning talk
 
Ignoring Internet is Injurious to Medical Practice
Ignoring Internet is Injurious to Medical PracticeIgnoring Internet is Injurious to Medical Practice
Ignoring Internet is Injurious to Medical Practice
 
魏权龄_数据包络分析法
魏权龄_数据包络分析法魏权龄_数据包络分析法
魏权龄_数据包络分析法
 
Datomic
DatomicDatomic
Datomic
 
Store accesory the best2
Store accesory the best2Store accesory the best2
Store accesory the best2
 
E20C Workshop: E20 & OE
E20C Workshop: E20 & OEE20C Workshop: E20 & OE
E20C Workshop: E20 & OE
 
Facts about RBI Governer Raghuram Rajan
Facts about RBI Governer Raghuram RajanFacts about RBI Governer Raghuram Rajan
Facts about RBI Governer Raghuram Rajan
 
HBK Heroes & Achievements
HBK Heroes & AchievementsHBK Heroes & Achievements
HBK Heroes & Achievements
 
Orientation Day Presentation (Personalized Learning)
Orientation Day Presentation (Personalized Learning) Orientation Day Presentation (Personalized Learning)
Orientation Day Presentation (Personalized Learning)
 
Wind Power Df Intro Uk
Wind Power Df Intro UkWind Power Df Intro Uk
Wind Power Df Intro Uk
 
Dosificación y jerarquización 2016 2017 (1)
Dosificación y jerarquización 2016 2017 (1)Dosificación y jerarquización 2016 2017 (1)
Dosificación y jerarquización 2016 2017 (1)
 
Requirements E20 Manager
Requirements E20 ManagerRequirements E20 Manager
Requirements E20 Manager
 
Gettysburg
GettysburgGettysburg
Gettysburg
 
Social Messaging Solution Matrix
Social Messaging Solution MatrixSocial Messaging Solution Matrix
Social Messaging Solution Matrix
 
Te amo-diapositivas
Te amo-diapositivasTe amo-diapositivas
Te amo-diapositivas
 
Coaching with the brain in mind
Coaching with the brain in mindCoaching with the brain in mind
Coaching with the brain in mind
 
Big data: Loading your data with flume and sqoop
Big data:  Loading your data with flume and sqoopBig data:  Loading your data with flume and sqoop
Big data: Loading your data with flume and sqoop
 
Exposicion sobre Vidrios
Exposicion sobre VidriosExposicion sobre Vidrios
Exposicion sobre Vidrios
 

Plus de Christophe Marchal (20)

Elasticsearch avoiding hotspots
Elasticsearch  avoiding hotspotsElasticsearch  avoiding hotspots
Elasticsearch avoiding hotspots
 
Performance
PerformancePerformance
Performance
 
Alluxio
AlluxioAlluxio
Alluxio
 
Elasticsearch cluster deep dive
Elasticsearch  cluster deep diveElasticsearch  cluster deep dive
Elasticsearch cluster deep dive
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 
Reactive programming with Rxjava
Reactive programming with RxjavaReactive programming with Rxjava
Reactive programming with Rxjava
 
Terraform
TerraformTerraform
Terraform
 
Consul in 5 minutes
Consul in 5 minutesConsul in 5 minutes
Consul in 5 minutes
 
Spark in 15 min
Spark in 15 minSpark in 15 min
Spark in 15 min
 
Microservices Architecture: Nirvana or Nightmare
Microservices Architecture: Nirvana or NightmareMicroservices Architecture: Nirvana or Nightmare
Microservices Architecture: Nirvana or Nightmare
 
Capistrano
CapistranoCapistrano
Capistrano
 
Aws, play! couch db scaling soa in the cloud
Aws, play! couch db  scaling soa in the cloudAws, play! couch db  scaling soa in the cloud
Aws, play! couch db scaling soa in the cloud
 
Devops e a nova cultura - TDC Florianopolis 2015
Devops e a nova cultura - TDC Florianopolis 2015Devops e a nova cultura - TDC Florianopolis 2015
Devops e a nova cultura - TDC Florianopolis 2015
 
Devops and the New Culture
Devops and the New CultureDevops and the New Culture
Devops and the New Culture
 
CUDA
CUDACUDA
CUDA
 
Monads in practice
Monads in practiceMonads in practice
Monads in practice
 
Productivity and scalability with Play and Scala
Productivity and scalability with Play and ScalaProductivity and scalability with Play and Scala
Productivity and scalability with Play and Scala
 
Reactive application
Reactive applicationReactive application
Reactive application
 
Internet of things and arduino
Internet of things and arduinoInternet of things and arduino
Internet of things and arduino
 
Hbase
HbaseHbase
Hbase
 

Dernier

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 

Dernier (20)

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 

Clojure Functions for Atomic Updates