Download ebooks file Introducing Blockchain with Lisp Implement and Extend Blockchains with the Racket Language Sitnikovski Boro all chapters
Download ebooks file Introducing Blockchain with Lisp Implement and Extend Blockchains with the Racket Language Sitnikovski Boro all chapters
com
https://textbookfull.com/product/introducing-
blockchain-with-lisp-implement-and-extend-
blockchains-with-the-racket-language-sitnikovski-
boro/
https://textbookfull.com/product/introducing-blockchain-with-lisp-
implement-and-extend-blockchains-with-the-racket-language-sitnikovski-
boro-2/
textbookfull.com
https://textbookfull.com/product/introducing-blockchain-with-lisp-
implement-and-extend-blockchains-with-the-racket-language-sitnikovski-
boro-3/
textbookfull.com
https://textbookfull.com/product/introduction-to-quantum-mechanics-
david-j-griffiths/
textbookfull.com
https://textbookfull.com/product/an-introduction-to-decision-theory-
martin-peterson/
textbookfull.com
https://textbookfull.com/product/deactivation-of-heavy-oil-
hydroprocessing-catalysts-fundamentals-and-modeling-jorge-ancheyta/
textbookfull.com
https://textbookfull.com/product/the-eu-promoting-regional-
integration-and-conflict-resolution-1st-edition-thomas-diez/
textbookfull.com
https://textbookfull.com/product/mobile-crowd-sensing-incentive-
mechanism-design-fen-hou/
textbookfull.com
A Level Further Mathematics for OCR A Pure Core Student
Book 2 Year 2 AS A Level Further Mathematics OCR Vesna
Kadelburg
https://textbookfull.com/product/a-level-further-mathematics-for-ocr-
a-pure-core-student-book-2-year-2-as-a-level-further-mathematics-ocr-
vesna-kadelburg/
textbookfull.com
Introducing
Blockchain
with Lisp
Implement and Extend Blockchains
with the Racket Language
—
Boro Sitnikovski
Introducing
Blockchain with Lisp
Implement and Extend
Blockchains with
the Racket Language
Boro Sitnikovski
Introducing Blockchain with Lisp: Implement and Extend
Blockchains
with the Racket Language
Boro Sitnikovski
Skopje, North Macedonia
ISBN-13 (pbk): 978-1-4842-6968-8
Structure, by D. Bozhinovski
© Boro Sitnikovski 2021
19
B. Sitnikovski, Introducing Blockchain with Lisp,
https://doi.org/10.1007/978-1-4842-6969-5_2
Chapter 2 raCket programming Language
Now that we have vaguely explained what a blockchain is and how it
is useful, the next obvious step is to implement these calculations in a
computer, so that they are automatically performed. In this chapter, we
introduce a tool that will allow us to implement these calculations exactly.
2.1 Introduction to Lisp
Lisp, originating from 1958, stands for LIST Processing and is a family
of programming languages. Unlike standard programming languages, it
has a fully parenthesized prefix notation. For example, instead of writing 1
+ 2, one would write (+ 1 2).
There are many Lisp implementations in the Lisp family. One such
implementation is Racket, and we will use it in this book since this
implementation is particularly easy for entry-level programmers. The
language is used in a variety of contexts such as research, computer
science education, and general-purpose programming. It has also been
used for commercial projects. One notable example is the Hacker News1
website, which runs on Arc, a programming language developed in
Racket.
Lisp implementations are quite known for their minimalism. Due to
this minimalism, building a blockchain (or anything, for that matter) in
Lisp will imply that you can do the same in most other programming
languages with ease. Lisps favor function composition—chaining two
functions together—for example, given f( x) and g( x), one composition is
f( g( x)). Further in the book, we will see the interesting properties that
composition offers and how easily we can maintain and extend our code.
1 https://news.ycombinator.com/
20
Chapter 2 raCket programming Language
2.1.1 Data Structures and Recursion
There are three important notions in a Lisp:
• Primitives or axioms (starting points or building blocks). As an
example, the numbers 1, 2, and so on,
are something we do not have to implement ourselves
since they are already included in the programming
language. Another example is operations on numbers,
such as + and *.
• Composition or a way to compose primitives to do complex
calculations. For example, we can combine
+ and * as follows: 1 + (2 * 3) or in prefix (Lisp)
notation: (+ 1 (* 2 3)).
• Abstraction or capturing the composition of primitives.
For example, if we find ourselves doing a calculation
over and over again, it would be good to capture
(abstract, or wrap) it in a function that can be easily
reused.
We will rely on these concepts repeatedly throughout the book, as
they allow us to build complex structures.
Definition 2-1
Random documents with unrelated
content Scribd suggests to you:
suotuisa, kävi matkamme nopeasti, ja aamun ensi valon sarastaissa
näimme kylän olevan noin peninkulman päässä. Sinne emme
kumminkaan uskaltaneet nousta, sillä meidät olisi tunnettu; siksi
ohjasimme veneemme muutamien kääpiömäisten vesipalmujen
suojaan, noin puolen englannin peninkulman päähän kylästä ja
läksimme, kätkettyämme veneen miten taisimme, viivyttelemättä
vuoristoa kohti.
"Oi, minä olen nähnyt unta!" hän läähätti. "Olen nähnyt kamalaa
unta.
Näin isäni saapuvan luokseni ja — en osaa sanoa — lapsi — lapsi
—".
Ja hän keskeytti eikä osannut sanoa sen enempää.
"Ei ole, armollinen rouva, mikäli minä olen kuullut. Mitä muita
syytöksiä saattaisi sitten olla?"
Silloin ilmestyi tuskan ilme Mayan kasvoille, jotta hän näytti kuin
äkkiä vanhentuneen. Sitten hän vastasi:
"Lähtekää ja ilmoittakaa niille, jotka lähettivät Teidät, Mayan,
Sydämen Ruhtinattaren, lausuneen näin: Lapseni on rakas minulle,
sillä se on liha minun lihaani; mutta mieheni on vieläkin rakkaampi,
sillä hän on sekä liha minun lihaani että sielu minun sieluani. Jos
minun täytyy valita näiden kahden välillä, valitsen hänet, joka on
läheisempi; sillä minähän voin saada toisen lapsen, mutta en
koskaan toista miestä."
KAHDESKYMMENESNELJÄS LUKU.
Nahua todistaa.
"En tiedä miksi niin teitte enkä välitä tietää, sillä mikään ei voi
sovittaa sellaista rikosta; mutta luulen Teidän tehneen niin,
saadaksenne mieheksenne tuon valkoisen miehen. Joka tapauksessa
on teko tehty ja kosto odottaa teitä — kosto, josta säästytte vain
yhdellä ehdolla."
"Maya, kaksi ihmistä elää, ja vain kaksi, jotka tietävät tämän asian
— vaimoni Nahua ja minä itse. Tähän aamuun asti oli vain yksi
ihminen, sillä Nahua kertoi sen minulle vasta huomattuaan ettette
päässeet pakoon, ja tämän hän teki aikeissa toimittaa surman Teille,
jota hän vihaa kilpailijattarenaan. Siksi olisi hän tahtonut pidättää
minua vainoamasta Teitä, ja siksi tahtoo hän saapua Sydämen
Neuvostoon tänä iltana, saadakseen varmasti nähdä Teidän kuolevan
Vetten Kuiluun. Mutta Teidän minä kaikkein vähimmin haluaisin
nähdä sinne häviävän, Teidän, jota nyt kuten aina rakastan,
enemmän kuin mitään muuta maan päällä."
"Nuo ovat jaloja sanoja, ystävä", Maya sanoi, "sanoja, jotka voivat
lähteä vain Teidän jalosta sydämestänne. No, mieheni, nyt on Teidän
vuoronne."
"Valkoinen mies", vastasi Tikal, "Te olette varmasti sekä hullu että
roisto, muutoin tuskin pyytäisitte minua panemaan henkeäni
onnenpeliin Teidän henkeänne vastaan, joka jo lain mukaan on
arvoton. — Hyvästi, Maya; kauan olette juoksuttanut ja kiduttanut
minua, tänä iltana saatte kaikesta palkkion." Niin hän lähti.
"Niin on, armollinen rouva", hän vastasi, "ja tietäkää, ettette te ole
ainoat tänä iltana syytetyt. Vaikka teidän asianne on ensinnä,
seuraavat ylipappi Tikalin ja muiden asiat perästäpäin; mutta siihen
asti istuu hän arvonsa mukaisesti Neuvoston puheenjohtajalta."
"Saman päivän iltana, jolloin Lordi Dimas oli käynyt luonani, olin
yksin huoneessani, ja Ruhtinatar Nahua, Tikalin puoliso, hiipi
luokseni aikoen surmata lapseni."
"Se on totta", vastasi Nahua, "ja minä todistan teille, että tuo
pyhäinhäväistys oli mahdollinen. Sydän avattiin, ja isäni tekemä
väärä ennustus pantiin sisään, mistä te sen löysitte Vetten Nousun
yönä vuosi takaperin. Mutta katso, kun pyhä sydän avattiin — se ei
ollutkaan tyhjä, vaan siinä oli toinen ennustus — oikea ennustus —
joka pantiin talteen, jotta petos selviäisi aikanaan."
Jäähyväiset.