#lang racket ;; A [Pair X Y] is a (list X Y) (define pair? list?) (define pair-x first) (define pair-y second) (define make-pair list) ;; A [Mapping X Y] is a [List-of [Pair X Y]] ;; and associates data of type X with data of type Y ;; get : [Mapping X Y] X -> Y ;; Get the value in m associated with x (define (get m x) (cond [(empty? m) (error "not found")] [else (if (equal? x (pair-x (first m))) (pair-y (first m)) (get (rest m) x))])) ;; update-mapping : [Mapping X Y] X [Y -> Y] Y -> [Mapping X Y] ;; Update the data associated with x in m using updater ;; If x is not in m, associate it with backup (define (update-mapping m x updater backup) (cond [(empty? m) (list (make-pair x backup))] [else (if (equal? x (pair-x (first m))) (cons (make-pair x (updater (pair-y (first m)))) (rest m)) (cons (first m) (update-mapping (rest m) x updater backup)))])) (define (symbols->strings lolos) (map (λ (l) (map (λ (s) (if (number? s) (number->string s) (symbol->string s))) l)) lolos)) (define THE-RAVEN (symbols->strings '((Once upon a midnight dreary while I pondered weak and weary) (Over many a quaint and curious volume of forgotten lore) (While I nodded nearly napping suddenly there came a tapping) (As of some one gently rapping rapping at my chamber door) (’Tis some visitor I muttered tapping at my chamber door) (Only this and nothing more) (Ah distinctly I remember it was in the bleak December) (And each separate dying ember wrought its ghost upon the floor) (Eagerly I wished the morrow vainly I had sought to borrow) (From my books surcease of sorrow sorrow for the lost Lenore) (For the rare and radiant maiden whom the angels name Lenore) (Nameless here for evermore) (And the silken sad uncertain rustling of each purple curtain) (Thrilled me filled me with fantastic terrors never felt before) (So that now to still the beating of my heart I stood repeating) (’Tis some visitor entreating entrance at my chamber door) (Some late visitor entreating entrance at my chamber door) (This it is and nothing more) (Presently my soul grew stronger hesitating then no longer) (Sir said I or Madam truly your forgiveness I implore) (But the fact is I was napping and so gently you came rapping) (And so faintly you came tapping tapping at my chamber door) (That I scarce was sure I heard you here I opened wide the door) (Darkness there and nothing more) (Deep into that darkness peering long I stood there wondering fearing) (Doubting dreaming dreams no mortal ever dared to dream before) (But the silence was unbroken and the stillness gave no token) (And the only word there spoken was the whispered word Lenore) (This I whispered and an echo murmured back the word Lenore) (Merely this and nothing more) (Back into the chamber turning all my soul within me burning) (Soon again I heard a tapping somewhat louder than before) (Surely said I surely that is something at my window lattice) ( Let me see then what thereat is and this mystery explore) (Let my heart be still a moment and this mystery explore) (’Tis the wind and nothing more) (Open here I flung the shutter when with many a flirt and flutter) (In there stepped a stately Raven of the saintly days of yore) (Not the least obeisance made he not a minute stopped or stayed he) (But with mien of lord or lady perched above my chamber door) (Perched upon a bust of Pallas just above my chamber door) (Perched and sat and nothing more) (Then this ebony bird beguiling my sad fancy into smiling) (By the grave and stern decorum of the countenance it wore) (Though thy crest be shorn and shaven thou I said art sure no craven) (Ghastly grim and ancient Raven wandering from the Nightly shore) (Tell me what thy lordly name is on the Night’s Plutonian shore) (Quoth the Raven Nevermore) (Much I marvelled this ungainly fowl to hear discourse so plainly) (Though its answer little meaning little relevancy bore) (For we cannot help agreeing that no living human being) (Ever yet was blessed with seeing bird above his chamber door) (Bird or beast upon the sculptured bust above his chamber door) (With such name as Nevermore) (But the Raven sitting lonely on the placid bust spoke only) (That w as if his soul in that one word he did outpour) (Nothing farther then he uttered not a feather then he fluttered) (Till I scarcely more than muttered Other friends have flown before) (On the morrow he will leave me as my Hopes have flown before) (Then the bird said Nevermore) (Startled at the stillness broken by reply so aptly spoken) (Doubtless said I what it utters is its only stock and store) (Caught from some unhappy master whom unmerciful Disaster) (Followed fast and followed faster till his songs one burden bore) (Till the dirges of his Hope that melancholy burden bore) (Of Never nevermore) (But the Raven still beguiling all my fancy into smiling) (Straight I wheeled a cushioned seat in front of bird and bust and door) (Then upon the velvet sinking I betook myself to linking) (Fancy unto fancy thinking what this ominous bird of yore) (What this grim ungainly ghastly gaunt and ominous bird of yore) (Meant in croaking Nevermore) (This I sat engaged in guessing but no syllable expressing) (To the fowl whose fiery eyes now burned into my bosom’s core) (This and more I sat divining with my head at ease reclining) (On the cushion’s velvet lining that the lamplight gloated o’er) (But whose velvet-violet lining with the lamplight gloating o’er) (She shall press ah nevermore) (Then methought the air grew denser perfumed from an unseen censer) (Swung by Seraphim whose foot-falls tinkled on the tufted floor) (Wretch I cried thy God hath lent thee by these angels he hath sent thee) (Respite respite and nepenthe from thy memories of Lenore) (Quaff oh quaff this kind nepenthe and forget this lost Lenore) (Quoth the Raven Nevermore) (Prophet said I thing of evil prophet still if bird or devil) (Whether Tempter sent or whether tempest tossed thee here ashore) (Desolate yet all undaunted on this desert land enchanted) (On this home by Horror haunted tell me truly I implore) (Is there is there balm in Gilead tell me tell me I implore) (Quoth the Raven Nevermore) (Prophet said I thing of evil prophet still if bird or devil) (By that Heaven that bends above us by that God we both adore) (Tell this soul with sorrow laden if within the distant Aidenn) (It shall clasp a sainted maiden whom the angels name Lenore) (Clasp a rare and radiant maiden whom the angels name Lenore) (Quoth the Raven Nevermore) (Be that word our sign of parting bird or fiend I shrieked upstarting) (Get thee back into the tempest and the Night’s Plutonian shore) (Leave no black plume as a token of that lie thy soul hath spoken) (Leave my loneliness unbroken quit the bust above my door) (Take thy beak from out my heart and take thy form from off my door) (Quoth the Raven Nevermore) (And the Raven never flitting still is sitting still is sitting) (On the pallid bust of Pallas just above my chamber door) (And his eyes have all the seeming of a demon’s that is dreaming) (And the lamp-light o’er him streaming throws his shadow on the floor) (And my soul from out that shadow that lies floating on the floor) (Shall be lifted nevermore)))) (define AMERICAN-PIE (symbols->strings '((A long long time ago) (I can still remember how) (That music used to make me smile) (And I knew if I had my chance) (That I could make those people dance) (And maybe they’d be happy for a while) (But February made me shiver) (With every paper I’d deliver) (Bad news on the doorstep) (I couldn’t take one more step) (I can’t remember if I cried) (When I read about his widowed bride) (Something touched me deep inside) (The day the music died) (So) (Bye bye Miss American Pie) (Drove my Chevy to the levee but the levee was dry) (And them good ole boys were drinking whiskey and rye) (Singin’ this’ll be the day that I die) (This’ll be the day that I die) (Did you write the book of love) (And do you have faith in God above) (If the Bible tells you so) (Do you believe in rock and roll) (Can music save your mortal soul) (And can you teach me how to dance real slow) (Well I know that you’re in love with him) (’Cause I saw you dancin’ in the gym) (You both kicked off your shoes) (Man I dig those rhythm and blues) (I was a lonely teenage broncin’ buck) (With a pink carnation and a pickup truck) (But I knew I was out of luck) (The day the music died) (I started singin’) (Bye bye Miss American Pie) (Drove my Chevy to the levee but the levee was dry) (And them good ole boys were drinking whiskey and rye) (Singin’ this’ll be the day that I die) (This’ll be the day that I die) (Now for ten years we’ve been on our own) (And moss grows fat on a rolling stone) (But that’s not how it used to be) (When the jester sang for the king and queen) (In a coat he borrowed from James Dean) (And a voice that came from you and me) (Oh and while the king was looking down) (The jester stole his thorny crown) (The courtroom was adjourned) (No verdict was returned) (And while Lennon read a book on Marx) (The quartet practiced in the park) (And we sang dirges in the dark) (The day the music died) (We were singin’) (Bye bye Miss American Pie) (Drove my Chevy to the levee but the levee was dry) (Them good ole boys were drinking whiskey and rye) (And singin’ this’ll be the day that I die) (This’ll be the day that I die) (Helter skelter in a summer swelter) (The birds flew off with a fallout shelter) (Eight miles high and falling fast) (It landed foul on the grass) (The players tried for a forward pass) (With the jester on the sidelines in a cast) (Now the half time air was sweet perfume) (While sergeants played a marching tune) (We all got up to dance) (Oh but we never got the chance) (’Cause the players tried to take the field) (The marching band refused to yield) (Do you recall what was revealed) (The day the music died) (We started singin’) (Bye bye Miss American Pie) (Drove my Chevy to the levee but the levee was dry) (Them good ole boys were drinking whiskey and rye) (And singin’ this’ll be the day that I die) (This’ll be the day that I die) (Oh and there we were all in one place) (A generation lost in space) (With no time left to start again) (So come on Jack be nimble Jack be quick) (Jack Flash sat on a candlestick) (’Cause fire is the devil’s only friend) (Oh and as I watched him on the stage) (My hands were clenched in fists of rage) (No angel born in Hell) (Could break that Satan’s spell) (And as the flames climbed high into the night) (To light the sacrificial rite) (I saw Satan laughing with delight) (The day the music died) (He was singin’) (Bye bye Miss American Pie) (Drove my Chevy to the levee but the levee was dry) (Them good ole boys were drinking whiskey and rye) (Singin’ this’ll be the day that I die) (This’ll be the day that I die) (I met a girl who sang the blues) (And I asked her for some happy news) (But she just smiled and turned away) (I went down to the sacred store) (Where I’d heard the music years before) (But the man there said the music wouldn’t play) (And in the streets the children screamed) (The lovers cried and the poets dreamed) (But not a word was spoken) (The church bells all were broken) (And the three men I admire most) (The Father Son and the Holy Ghost) (They caught the last train for the coast) (The day the music died) (And they were singing) (Bye bye Miss American Pie) (Drove my Chevy to the levee but the levee was dry) (And them good ole boys were drinking whiskey and rye) (Singin’ this’ll be the day that I die) (This’ll be the day that I die) (They were singing) (Bye bye Miss American Pie) (Drove my Chevy to the levee but the levee was dry) (Them good ole boys were drinking whiskey and rye) (Singin’ this’ll be the day that I die)))) (define SCARLET-LETTER (symbols->strings '((Hester Prynne’s term of confinement was now at an end) (Her prison door was thrown open and she came forth into the sunshine which falling on all alike seemed to her sick and morbid heart as if meant for no other purpose than to reveal the scarlet letter on her breast) (Perhaps there was a more real torture in her first unattended footsteps from the threshold of the prison than even in the procession and spectacle that have been described where she was made the common infamy at which all mankind was summoned to point its finger) (Then she was supported by an unnatural tension of the nerves and by all the combative energy of her character which enabled her to convert the scene into a kind of lurid triumph) (It was moreover a separate and insulated event to occur but once in her lifetime and to meet which therefore reckless of economy she might call up the vital strength that would have sufficed for many quiet years) (The very law that condemned her a giant of stern features but with vigour to support as well as to annihilate in his iron arm had held her up through the terrible ordeal of her ignominy) (But now with this unattended walk from her prison door began the daily custom and she must either sustain and carry it forward by the ordinary resources of her nature or sink beneath it) (She could no longer borrow from the future to help her through the present grief) (Tomorrow would bring its own trial with it so would the next day and so would the next each its own trial and yet the very same that was now so unutterably grievous to be borne) (The days of the far off future would toil onward still with the same burden for her to take up and bear along with her but never to fling down for the accumulating days and added years would pile up their misery upon the heap of shame) (Throughout them all giving up her individuality she would become the general symbol at which the preacher and moralist might point and in which they might vivify and embody their images of woman’s frailty and sinful passion) (Thus the young and pure would be taught to look at her with the scarlet letter flaming on her breast at her the child of honourable parents at her the mother of a babe that would hereafter be a woman at her who had once been innocent as the figure the body the reality of sin) (And over her grave the infamy that she must carry thither would be her only monument) (It may seem marvellous that with the world before her kept by no restrictive clause of her condemnation within the limits of the Puritan settlement so remote and so obscure free to return to her birth place or to any other European land and there hide her character and identity under a new exterior as completely as if emerging into another state of being and having also the passes of the dark inscrutable forest open to her where the wildness of her nature might assimilate itself with a people whose customs and life were alien from the law that had condemned her it may seem marvellous that this woman should still call that place her home where and where only she must needs be the type of shame) (But there is a fatality a feeling so irresistible and inevitable that it has the force of doom which almost invariably compels human beings to linger around and haunt ghost like the spot where some great and marked event has given the colour to their lifetime and still the more irresistibly the darker the tinge that saddens it) (Her sin her ignominy were the roots which she had struck into the soil) (It was as if a new birth with stronger assimilations than the first had converted the forest land still so uncongenial to every other pilgrim and wanderer into Hester Prynne’s wild and dreary but life long home) (All other scenes of earth even that village of rural England where happy infancy and stainless maidenhood seemed yet to be in her mother’s keeping like garments put off long ago were foreign to her in comparison) (The chain that bound her here was of iron links and galling to her inmost soul but could never be broken) (It might be too doubtless it was so although she hid the secret from herself and grew pale whenever it struggled out of her heart like a serpent from its hole it might be that another feeling kept her within the scene and pathway that had been so fatal) (There dwelt there trode the feet of one with whom she deemed herself connected in a union that unrecognised on earth would bring them together before the bar of final judgment and make that their marriage altar for a joint futurity of endless retribution) (Over and over again the tempter of souls had thrust this idea upon Hester’s contemplation and laughed at the passionate and desperate joy with which she seized and then strove to cast it from her) (She barely looked the idea in the face and hastened to bar it in its dungeon) (What she compelled herself to believe what finally she reasoned upon as her motive for continuing a resident of New England was half a truth and half a self delusion) (Here she said to herself had been the scene of her guilt and here should be the scene of her earthly punishment and so perchance the torture of her daily shame would at length purge her soul and work out another purity than that which she had lost more saint like because the result of martyrdom) (Hester Prynne therefore did not flee) (On the outskirts of the town within the verge of the peninsula but not in close vicinity to any other habitation there was a small thatched cottage) (It had been built by an earlier settler and abandoned because the soil about it was too sterile for cultivation while its comparative remoteness put it out of the sphere of that social activity which already marked the habits of the emigrants) (It stood on the shore looking across a basin of the sea at the forest covered hills towards the west) (A clump of scrubby trees such as alone grew on the peninsula did not so much conceal the cottage from view as seem to denote that here was some object which would fain have been or at least ought to be concealed) (In this little lonesome dwelling with some slender means that she possessed and by the licence of the magistrates who still kept an inquisitorial watch over her Hester established herself with her infant child) (A mystic shadow of suspicion immediately attached itself to the spot) (Children too young to comprehend wherefore this woman should be shut out from the sphere of human charities would creep nigh enough to behold her plying her needle at the cottage window or standing in the doorway or labouring in her little garden or coming forth along the pathway that led townward and discerning the scarlet letter on her breast would scamper off with a strange contagious fear) (Lonely as was Hester’s situation and without a friend on earth who dared to show himself she however incurred no risk of want) (She possessed an art that sufficed even in a land that afforded comparatively little scope for its exercise to supply food for her thriving infant and herself) (It was the art then as now almost the only one within a woman’s grasp of needle work) (She bore on her breast in the curiously embroidered letter a specimen of her delicate and imaginative skill of which the dames of a court might gladly have availed themselves to add the richer and more spiritual adornment of human ingenuity to their fabrics of silk and gold) (Here indeed in the sable simplicity that generally characterised the Puritanic modes of dress there might be an infrequent call for the finer productions of her handiwork) (Yet the taste of the age demanding whatever was elaborate in compositions of this kind did not fail to extend its influence over our stern progenitors who had cast behind them so many fashions which it might seem harder to dispense with) (Public ceremonies such as ordinations the installation of magistrates and all that could give majesty to the forms in which a new government manifested itself to the people were as a matter of policy marked by a stately and well conducted ceremonial and a sombre but yet a studied magnificence) (Deep ruffs painfully wrought bands and gorgeously embroidered gloves were all deemed necessary to the official state of men assuming the reins of power and were readily allowed to individuals dignified by rank or wealth even while sumptuary laws forbade these and similar extravagances to the plebeian order) (In the array of funerals too whether for the apparel of the dead body or to typify by manifold emblematic devices of sable cloth and snowy lawn the sorrow of the survivors there was a frequent and characteristic demand for such labour as Hester Prynne could supply) (Baby linen for babies then wore robes of state afforded still another possibility of toil and emolument) (By degrees not very slowly her handiwork became what would now be termed the fashion) (Whether from commiseration for a woman of so miserable a destiny or from the morbid curiosity that gives a fictitious value even to common or worthless things or by whatever other intangible circumstance was then as now sufficient to bestow on some persons what others might seek in vain or because Hester really filled a gap which must otherwise have remained vacant it is certain that she had ready and fairly requited employment for as many hours as she saw fit to occupy with her needle) (Vanity it may be chose to mortify itself by putting on for ceremonials of pomp and state the garments that had been wrought by her sinful hands) (Her needle work was seen on the ruff of the Governor military men wore it on their scarfs and the minister on his band it decked the baby’s little cap it was shut up to be mildewed and moulder away in the coffins of the dead) (But it is not recorded that in a single instance her skill was called in to embroider the white veil which was to cover the pure blushes of a bride) (The exception indicated the ever relentless vigour with which society frowned upon her sin) (Hester sought not to acquire anything beyond a subsistence of the plainest and most ascetic description for herself and a simple abundance for her child) (Her own dress was of the coarsest materials and the most sombre hue with only that one ornament the scarlet letter which it was her doom to wear) (The child’s attire on the other hand was distinguished by a fanciful or we may rather say a fantastic ingenuity which served indeed to heighten the airy charm that early began to develop itself in the little girl but which appeared to have also a deeper meaning) (We may speak further of it hereafter) (Except for that small expenditure in the decoration of her infant Hester bestowed all her superfluous means in charity on wretches less miserable than herself and who not unfrequently insulted the hand that fed them) (Much of the time which she might readily have applied to the better efforts of her art she employed in making coarse garments for the poor) (It is probable that there was an idea of penance in this mode of occupation and that she offered up a real sacrifice of enjoyment in devoting so many hours to such rude handiwork) (She had in her nature a rich voluptuous Oriental characteristic a taste for the gorgeously beautiful which save in the exquisite productions of her needle found nothing else in all the possibilities of her life to exercise itself upon) (Women derive a pleasure incomprehensible to the other sex from the delicate toil of the needle) (To Hester Prynne it might have been a mode of expressing and therefore soothing the passion of her life) (Like all other joys she rejected it as sin) (This morbid meddling of conscience with an immaterial matter betokened it is to be feared no genuine and steadfast penitence but something doubtful something that might be deeply wrong beneath) (In this manner Hester Prynne came to have a part to perform in the world) (With her native energy of character and rare capacity it could not entirely cast her off although it had set a mark upon her more intolerable to a woman’s heart than that which branded the brow of Cain) (In all her intercourse with society however there was nothing that made her feel as if she belonged to it) (Every gesture every word and even the silence of those with whom she came in contact implied and often expressed that she was banished and as much alone as if she inhabited another sphere or communicated with the common nature by other organs and senses than the rest of human kind) (She stood apart from mortal interests yet close beside them like a ghost that revisits the familiar fireside and can no longer make itself seen or felt no more smile with the household joy nor mourn with the kindred sorrow or should it succeed in manifesting its forbidden sympathy awakening only terror and horrible repugnance) (These emotions in fact and its bitterest scorn besides seemed to be the sole portion that she retained in the universal heart) (It was not an age of delicacy and her position although she understood it well and was in little danger of forgetting it was often brought before her vivid self perception like a new anguish by the rudest touch upon the tenderest spot) (The poor as we have already said whom she sought out to be the objects of her bounty often reviled the hand that was stretched forth to succour them) (Dames of elevated rank likewise whose doors she entered in the way of her occupation were accustomed to distil drops of bitterness into her heart sometimes through that alchemy of quiet malice by which women can concoct a subtle poison from ordinary trifles and sometimes also by a coarser expression that fell upon the sufferer’s defenceless breast like a rough blow upon an ulcerated wound) (Hester had schooled herself long and well and she never responded to these attacks save by a flush of crimson that rose irrepressibly over her pale cheek and again subsided into the depths of her bosom) (She was patient a martyr indeed but she forebore to pray for enemies lest in spite of her forgiving aspirations the words of the blessing should stubbornly twist themselves into a curse) (Continually and in a thousand other ways did she feel the innumerable throbs of anguish that had been so cunningly contrived for her by the undying the ever active sentence of the Puritan tribunal) (Clergymen paused in the streets to address words of exhortation that brought a crowd with its mingled grin and frown around the poor sinful woman) (If she entered a church trusting to share the Sabbath smile of the Universal Father it was often her mishap to find herself the text of the discourse) (She grew to have a dread of children for they had imbibed from their parents a vague idea of something horrible in this dreary woman gliding silently through the town with never any companion but one only child) (Therefore first allowing her to pass they pursued her at a distance with shrill cries and the utterances of a word that had no distinct purport to their own minds but was none the less terrible to her as proceeding from lips that babbled it unconsciously) (It seemed to argue so wide a diffusion of her shame that all nature knew of it it could have caused her no deeper pang had the leaves of the trees whispered the dark story among themselves had the summer breeze murmured about it had the wintry blast shrieked it aloud) (Another peculiar torture was felt in the gaze of a new eye) (When strangers looked curiously at the scarlet letter and none ever failed to do so they branded it afresh in Hester’s soul so that oftentimes she could scarcely refrain yet always did refrain from covering the symbol with her hand) (But then again an accustomed eye had likewise its own anguish to inflict) (Its cool stare of familiarity was intolerable) (From first to last in short Hester Prynne had always this dreadful agony in feeling a human eye upon the token the spot never grew callous it seemed on the contrary to grow more sensitive with daily torture) (But sometimes once in many days or perchance in many months she felt an eye a human eye upon the ignominious brand that seemed to give a momentary relief as if half of her agony were shared) (The next instant back it all rushed again with still a deeper throb of pain for in that brief interval she had sinned anew) (Her imagination was somewhat affected and had she been of a softer moral and intellectual fibre would have been still more so by the strange and solitary anguish of her life) (Walking to and fro with those lonely footsteps in the little world with which she was outwardly connected it now and then appeared to Hester if altogether fancy it was nevertheless too potent to be resisted she felt or fancied then that the scarlet letter had endowed her with a new sense) (She shuddered to believe yet could not help believing that it gave her a sympathetic knowledge of the hidden sin in other hearts) (She was terror stricken by the revelations that were thus made) (What were they) (Could they be other than the insidious whispers of the bad angel who would fain have persuaded the struggling woman as yet only half his victim that the outward guise of purity was but a lie and that if truth were everywhere to be shown a scarlet letter would blaze forth on many a bosom besides Hester Prynne’s) (Or must she receive those intimations so obscure yet so distinct as truth) (In all her miserable experience there was nothing else so awful and so loathsome as this sense) (It perplexed as well as shocked her by the irreverent inopportuneness of the occasions that brought it into vivid action) (Sometimes the red infamy upon her breast would give a sympathetic throb as she passed near a venerable minister or magistrate the model of piety and justice to whom that age of antique reverence looked up as to a mortal man in fellowship with angels) (What evil thing is at hand) (would Hester say to herself) (Lifting her reluctant eyes there would be nothing human within the scope of view save the form of this earthly saint) (Again a mystic sisterhood would contumaciously assert itself as she met the sanctified frown of some matron who according to the rumour of all tongues had kept cold snow within her bosom throughout life) (That unsunned snow in the matron’s bosom and the burning shame on Hester Prynne’s what had the two in common) (Or once more the electric thrill would give her warning Behold Hester here is a companion) (and looking up she would detect the eyes of a young maiden glancing at the scarlet letter shyly and aside and quickly averted with a faint chill crimson in her cheeks as if her purity were somewhat sullied by that momentary glance) (O Fiend whose talisman was that fatal symbol wouldst thou leave nothing whether in youth or age for this poor sinner to revere) (such loss of faith is ever one of the saddest results of sin) (Be it accepted as a proof that all was not corrupt in this poor victim of her own frailty and man’s hard law that Hester Prynne yet struggled to believe that no fellow mortal was guilty like herself) (The vulgar who in those dreary old times were always contributing a grotesque horror to what interested their imaginations had a story about the scarlet letter which we might readily work up into a terrific legend) (They averred that the symbol was not mere scarlet cloth tinged in an earthly dye pot but was red hot with infernal fire and could be seen glowing all alight whenever Hester Prynne walked abroad in the night time) (And we must needs say it seared Hester’s bosom so deeply that perhaps there was more truth in the rumour than our modern incredulity may be inclined to admit)))) (define TEN-PLAGUES (symbols->strings '((And the LORD said unto Moses See I have made thee a god to Pharaoh and Aaron thy brother shall be thy prophet) (Thou shalt speak all that I command thee and Aaron thy brother shall speak unto Pharaoh that he send the children of Israel out of his land) (And I will harden Pharaoh’s heart and multiply my signs and my wonders in the land of Egypt) (But Pharaoh shall not hearken unto you that I may lay my hand upon Egypt and bring forth mine armies and my people the children of Israel out of the land of Egypt by great judgments) (And the Egyptians shall know that I am the LORD when I stretch forth mine hand upon Egypt and bring out the children of Israel from among them) (And Moses and Aaron did as the LORD commanded them so did they) (And Moses was fourscore years old and Aaron fourscore and three years old when they spake unto Pharaoh) (And the LORD spake unto Moses and unto Aaron saying When Pharaoh shall speak unto you saying Shew a miracle for you then thou shalt say unto Aaron Take thy rod and cast it before Pharaoh and it shall become a serpent) (And Moses and Aaron went in unto Pharaoh and they did so as the LORD had commanded and Aaron cast down his rod before Pharaoh and before his servants and it became a serpent) (Then Pharaoh also called the wise men and the sorcerers now the magicians of Egypt they also did in like manner with their enchantments) (For they cast down every man his rod and they became serpents but Aaron’s rod swallowed up their rods) (And he hardened Pharaoh’s heart that he hearkened not unto them as the LORD had said) (And the LORD said unto Moses Pharaoh’s heart is hardened he refuseth to let the people go) (Get thee unto Pharaoh in the morning lo he goeth out unto the water and thou shalt stand by the river’s brink against he come and the rod which was turned to a serpent shalt thou take in thine hand) (And thou shalt say unto him The LORD God of the Hebrews hath sent me unto thee saying Let my people go that they may serve me in the wilderness and behold hitherto thou wouldest not hear) (Thus saith the LORD In this thou shalt know that I am the LORD behold I will smite with the rod that is in mine hand upon the waters which are in the river and they shall be turned to blood) (And the fish that is in the river shall die and the river shall stink and the Egyptians shall lothe to drink of the water of the river) (And the LORD spake unto Moses Say unto Aaron Take thy rod and stretch out thine hand upon the waters of Egypt upon their streams upon their rivers and upon their ponds and upon all their pools of water that they may become blood and that there may be blood throughout all the land of Egypt both in vessels of wood and in vessels of stone) (And Moses and Aaron did so as the LORD commanded and he lifted up the rod and smote the waters that were in the river in the sight of Pharaoh and in the sight of his servants and all the waters that were in the river were turned to blood) (And the fish that was in the river died and the river stank and the Egyptians could not drink of the water of the river and there was blood throughout all the land of Egypt) (And the magicians of Egypt did so with their enchantments and Pharaoh’s heart was hardened neither did he hearken unto them as the LORD had said) (And Pharaoh turned and went into his house neither did he set his heart to this also) (And all the Egyptians digged round about the river for water to drink for they could not drink of the water of the river) (And seven days were fulfilled after that the LORD had smitten the river) (And the LORD spake unto Moses Go unto Pharaoh and say unto him Thus saith the LORD Let my people go that they may serve me) (And if thou refuse to let them go behold I will smite all thy borders with frogs And the river shall bring forth frogs abundantly which shall go up and come into thine house and into thy bedchamber and upon thy bed and into the house of thy servants and upon thy people and into thine ovens and into thy kneadingtroughs And the frogs shall come up both on thee and upon thy people and upon all thy servants) (And the LORD spake unto Moses Say unto Aaron Stretch forth thine hand with thy rod over the streams over the rivers and over the ponds and cause frogs to come up upon the land of Egypt) (And Aaron stretched out his hand over the waters of Egypt and the frogs came up and covered the land of Egypt) (And the magicians did so with their enchantments and brought up frogs upon the land of Egypt) (Then Pharaoh called for Moses and Aaron and said Intreat the LORD that he may take away the frogs from me and from my people and I will let the people go that they may do sacrifice unto the LORD) (And Moses said unto Pharaoh Glory over me when shall I intreat for thee and for thy servants and for thy people to destroy the frogs from thee and thy houses that they may remain in the river only? And he said To morrow And he said Be it according to thy word that thou mayest know that there is none like unto the LORD our God) (And the frogs shall depart from thee and from thy houses and from thy servants and from thy people they shall remain in the river only) (And Moses and Aaron went out from Pharaoh and Moses cried unto the LORD because of the frogs which he had brought against Pharaoh) (And the LORD did according to the word of Moses and the frogs died out of the houses out of the villages and out of the fields) (And they gathered them together upon heaps and the land stank) (But when Pharaoh saw that there was respite he hardened his heart and hearkened not unto them as the LORD had said) (And the LORD said unto Moses Say unto Aaron Stretch out thy rod and smite the dust of the land that it may become lice throughout all the land of Egypt) (And they did so for Aaron stretched out his hand with his rod and smote the dust of the earth and it became lice in man and in beast all the dust of the land became lice throughout all the land of Egypt) (And the magicians did so with their enchantments to bring forth lice but they could not so there were lice upon man and upon beast) (Then the magicians said unto Pharaoh This is the finger of God and Pharaoh’s heart was hardened and he hearkened not unto them as the LORD had said) (And the LORD said unto Moses Rise up early in the morning and stand before Pharaoh lo he cometh forth to the water and say unto him Thus saith the LORD Let my people go that they may serve me) (Else if thou wilt not let my people go behold I will send swarms of flies upon thee and upon thy servants and upon thy people and into thy houses and the houses of the Egyptians shall be full of swarms of flies and also the ground whereon they are) (And I will sever in that day the land of Goshen in which my people dwell that no swarms of flies shall be there to the end thou mayest know that I am the LORD in the midst of the earth) (And I will put a division between my people and thy people to morrow shall this sign be) (And the LORD did so and there came a grievous swarm of flies into the house of Pharaoh and into his servants’ houses and into all the land of Egypt the land was corrupted by reason of the swarm of flies) (And Pharaoh called for Moses and for Aaron and said Go ye sacrifice to your God in the land) (And Moses said It is not meet so to do for we shall sacrifice the abomination of the Egyptians to the LORD our God lo shall we sacrifice the abomination of the Egyptians before their eyes and will they not stone us? We will go three days’ journey into the wilderness and sacrifice to the LORD our God as he shall command us) (And Pharaoh said I will let you go that ye may sacrifice to the LORD your God in the wilderness only ye shall not go very far away intreat for me) (And Moses said Behold I go out from thee and I will intreat the LORD that the swarms of flies may depart from Pharaoh from his servants and from his people to morrow but let not Pharaoh deal deceitfully any more in not letting the people go to sacrifice to the LORD) (And Moses went out from Pharaoh and intreated the LORD) (And the LORD did according to the word of Moses and he removed the swarms of flies from Pharaoh from his servants and from his people there remained not one) (And Pharaoh hardened his heart at this time also neither would he let the people go) (Then the LORD said unto Moses Go in unto Pharaoh and tell him Thus saith the LORD God of the Hebrews Let my people go that they may serve me) (For if thou refuse to let them go and wilt hold them still Behold the hand of the LORD is upon thy cattle which is in the field upon the horses upon the asses upon the camels upon the oxen and upon the sheep there shall be a very grievous murrain) (And the LORD shall sever between the cattle of Israel and the cattle of Egypt and there shall nothing die of all that is the children’s of Israel) (And the LORD appointed a set time saying To morrow the LORD shall do this thing in the land) (And the LORD did that thing on the morrow and all the cattle of Egypt died but of the cattle of the children of Israel died not one) (And Pharaoh sent and behold there was not one of the cattle of the Israelites dead And the heart of Pharaoh was hardened and he did not let the people go) (And the LORD said unto Moses and unto Aaron Take to you handfuls of ashes of the furnace and let Moses sprinkle it toward the heaven in the sight of Pharaoh) (And it shall become small dust in all the land of Egypt and shall be a boil breaking forth with blains upon man and upon beast throughout all the land of Egypt) (And they took ashes of the furnace and stood before Pharaoh and Moses sprinkled it up toward heaven and it became a boil breaking forth with blains upon man and upon beast) (And the magicians could not stand before Moses because of the boils for the boil was upon the magicians and upon all the Egyptians) (And the LORD hardened the heart of Pharaoh and he hearkened not unto them as the LORD had spoken unto Moses) (And the LORD said unto Moses Rise up early in the morning and stand before Pharaoh and say unto him Thus saith the LORD God of the Hebrews Let my people go that they may serve me) (For I will at this time send all my plagues upon thine heart and upon thy servants and upon thy people that thou mayest know that there is none like me in all the earth) (For now I will stretch out my hand that I may smite thee and thy people with pestilence and thou shalt be cut off from the earth) (And in very deed for this cause have I raised thee up for to shew in thee my power and that my name may be declared throughout all the earth) (As yet exaltest thou thyself against my people that thou wilt not let them go? Behold to morrow about this time I will cause it to rain a very grievous hail such as hath not been in Egypt since the foundation thereof even until now) (Send therefore now and gather thy cattle and all that thou hast in the field for upon every man and beast which shall be found in the field and shall not be brought home the hail shall come down upon them and they shall die) (He that feared the word of the LORD among the servants of Pharaoh made his servants and his cattle flee into the houses And he that regarded not the word of the LORD left his servants and his cattle in the field) (And the LORD said unto Moses Stretch forth thine hand toward heaven that there may be hail in all the land of Egypt upon man and upon beast and upon every herb of the field throughout the land of Egypt) (And Moses stretched forth his rod toward heaven and the LORD sent thunder and hail and the fire ran along upon the ground and the LORD rained hail upon the land of Egypt) (So there was hail and fire mingled with the hail very grievous such as there was none like it in all the land of Egypt since it became a nation) (And the hail smote throughout all the land of Egypt all that was in the field both man and beast and the hail smote every herb of the field and brake every tree of the field) (Only in the land of Goshen where the children of Israel were was there no hail) (And Pharaoh sent and called for Moses and Aaron and said unto them I have sinned this time the LORD is righteous and I and my people are wicked) (Intreat the LORD for it is enough that there be no more mighty thunderings and hail and I will let you go and ye shall stay no longer) (And Moses said unto him As soon as I am gone out of the city I will spread abroad my hands unto the LORD and the thunder shall cease neither shall there be any more hail that thou mayest know how that the earth is the LORD’s) (But as for thee and thy servants I know that ye will not yet fear the LORD God) (And the flax and the barley was smitten for the barley was in the ear and the flax was bolled) (But the wheat and the rie were not smitten for they were not grown up) (And Moses went out of the city from Pharaoh and spread abroad his hands unto the LORD and the thunders and hail ceased and the rain was not poured upon the earth) (And when Pharaoh saw that the rain and the hail and the thunders were ceased he sinned yet more and hardened his heart he and his servants) (And the heart of Pharaoh was hardened neither would he let the children of Israel go as the LORD had spoken by Moses) (And the LORD said unto Moses Go in unto Pharaoh for I have hardened his heart and the heart of his servants that I might shew these my signs before him And that thou mayest tell in the ears of thy son and of thy son’s son what things I have wrought in Egypt and my signs which I have done among them that ye may know how that I am the LORD) (And Moses and Aaron came in unto Pharaoh and said unto him Thus saith the LORD God of the Hebrews How long wilt thou refuse to humble thyself before me? let my people go that they may serve me) (Else if thou refuse to let my people go behold to morrow will I bring the locusts into thy coast And they shall cover the face of the earth that one cannot be able to see the earth and they shall eat the residue of that which is escaped which remaineth unto you from the hail and shall eat every tree which groweth for you out of the field And they shall fill thy houses and the houses of all thy servants and the houses of all the Egyptians which neither thy fathers nor thy fathers’ fathers have seen since the day that they were upon the earth unto this day And he turned himself and went out from Pharaoh) (And Pharaoh’s servants said unto him How long shall this man be a snare unto us? let the men go that they may serve the LORD their God knowest thou not yet that Egypt is destroyed? And Moses and Aaron were brought again unto Pharaoh and he said unto them Go serve the LORD your God but who are they that shall go? And Moses said We will go with our young and with our old with our sons and with our daughters with our flocks and with our herds will we go for we must hold a feast unto the LORD) (And he said unto them Let the LORD be so with you as I will let you go and your little ones look to it for evil is before you) (Not so go now ye that are men and serve the LORD for that ye did desire And they were driven out from Pharaoh’s presence) (And the LORD said unto Moses Stretch out thine hand over the land of Egypt for the locusts that they may come up upon the land of Egypt and eat every herb of the land even all that the hail hath left) (And Moses stretched forth his rod over the land of Egypt and the LORD brought an east wind upon the land all that day and all that night and when it was morning the east wind brought the locusts) (And the locust went up over all the land of Egypt and rested in all the coasts of Egypt very grievous were they before them there were no such locusts as they neither after them shall be such) (For they covered the face of the whole earth so that the land was darkened and they did eat every herb of the land and all the fruit of the trees which the hail had left and there remained not any green thing in the trees or in the herbs of the field through all the land of Egypt) (Then Pharaoh called for Moses and Aaron in haste and he said I have sinned against the LORD your God and against you) (Now therefore forgive I pray thee my sin only this once and intreat the LORD your God that he may take away from me this death only) (And he went out from Pharaoh and intreated the LORD) (And the LORD turned a mighty strong west wind which took away the locusts and cast them into the Red sea there remained not one locust in all the coasts of Egypt) (But the LORD hardened Pharaoh’s heart so that he would not let the children of Israel go) (And the LORD said unto Moses Stretch out thine hand toward heaven that there may be darkness over the land of Egypt even darkness which may be felt) (And Moses stretched forth his hand toward heaven and there was a thick darkness in all the land of Egypt three days They saw not one another neither rose any from his place for three days but all the children of Israel had light in their dwellings) (And Pharaoh called unto Moses and said Go ye serve the LORD only let your flocks and your herds be stayed let your little ones also go with you) (And Moses said Thou must give us also sacrifices and burnt offerings that we may sacrifice unto the LORD our God) (Our cattle also shall go with us there shall not an hoof be left behind for thereof must we take to serve the LORD our God and we know not with what we must serve the LORD until we come thither) (But the LORD hardened Pharaoh’s heart and he would not let them go) (And Pharaoh said unto him Get thee from me take heed to thyself see my face no more for in that day thou seest my face thou shalt die) (And Moses said Thou hast spoken well I will see thy face again no more) (And the LORD said unto Moses Yet will I bring one plague more upon Pharaoh and upon Egypt afterwards he will let you go hence when he shall let you go he shall surely thrust you out hence altogether) (Speak now in the ears of the people and let every man borrow of his neighbour and every woman of her neighbour jewels of silver and jewels of gold) (And the LORD gave the people favour in the sight of the Egyptians) (Moreover the man Moses was very great in the land of Egypt in the sight of Pharaoh’s servants and in the sight of the people) (And Moses said Thus saith the LORD About midnight will I go out into the midst of Egypt And all the firstborn in the land of Egypt shall die from the first born of Pharaoh that sitteth upon his throne even unto the firstborn of the maidservant that is behind the mill and all the firstborn of beasts) (And there shall be a great cry throughout all the land of Egypt such as there was none like it nor shall be like it any more) (But against any of the children of Israel shall not a dog move his tongue against man or beast that ye may know how that the LORD doth put a difference between the Egyptians and Israel) (And all these thy servants shall come down unto me and bow down themselves unto me saying Get thee out and all the people that follow thee and after that I will go out And he went out from Pharaoh in a great anger) (And the LORD said unto Moses Pharaoh shall not hearken unto you that my wonders may be multiplied in the land of Egypt) (And Moses and Aaron did all these wonders before Pharaoh and the LORD hardened Pharaoh’s heart so that he would not let the children of Israel go out of his land) (And the LORD spake unto Moses and Aaron in the land of Egypt saying This month shall be unto you the beginning of months it shall be the first month of the year to you) (Speak ye unto all the congregation of Israel saying In the tenth day of this month they shall take to them every man a lamb according to the house of their fathers a lamb for an house And if the household be too little for the lamb let him and his neighbour next unto his house take it according to the number of the souls every man according to his eating shall make your count for the lamb) (Your lamb shall be without blemish a male of the first year ye shall take it out from the sheep or from the goats And ye shall keep it up until the fourteenth day of the same month and the whole assembly of the congregation of Israel shall kill it in the evening) (And they shall take of the blood and strike it on the two side posts and on the upper door post of the houses wherein they shall eat it) (And they shall eat the flesh in that night roast with fire and unleavened bread and with bitter herbs they shall eat it) (Eat not of it raw nor sodden at all with water but roast with fire his head with his legs and with the purtenance thereof) (And ye shall let nothing of it remain until the morning and that which remaineth of it until the morning ye shall burn with fire) (And thus shall ye eat it with your loins girded your shoes on your feet and your staff in your hand and ye shall eat it in haste it is the LORD’s passover) (For I will pass through the land of Egypt this night and will smite all the firstborn in the land of Egypt both man and beast and against all the gods of Egypt I will execute judgment I am the LORD) (And the blood shall be to you for a token upon the houses where ye are and when I see the blood I will pass over you and the plague shall not be upon you to destroy you when I smite the land of Egypt) (And this day shall be unto you for a memorial and ye shall keep it a feast to the LORD throughout your generations ye shall keep it a feast by an ordinance for ever) (Seven days shall ye eat unleavened bread even the first day ye shall put away leaven out of your houses for whosoever eateth leavened bread from the first day until the seventh day that soul shall be cut off from Israel) (And in the first day there shall be an holy convocation and in the seventh day there shall be an holy convocation to you no manner of work shall be done in them save that which every man must eat that only may be done of you) (And ye shall observe the feast of unleavened bread for in this selfsame day have I brought your armies out of the land of Egypt therefore shall ye observe this day in your generations by an ordinance for ever) (In the first month on the fourteenth day of the month at even ye shall eat unleavened bread until the one and twentieth day of the month at even) (Seven days shall there be no leaven found in your houses for whosoever eateth that which is leavened even that soul shall be cut off from the congregation of Israel whether he be a stranger or born in the land) (Ye shall eat nothing leavened in all your habitations shall ye eat unleavened bread) (Then Moses called for all the elders of Israel and said unto them Draw out and take you a lamb according to your families and kill the passover) (And ye shall take a bunch of hyssop and dip it in the blood that is in the bason and strike the lintel and the two side posts with the blood that is in the bason and none of you shall go out at the door of his house until the morning) (For the LORD will pass through to smite the Egyptians and when he seeth the blood upon the lintel and on the two side posts the LORD will pass over the door and will not suffer the destroyer to come in unto your houses to smite you) (And ye shall observe this thing for an ordinance to thee and to thy sons for ever) (And it shall come to pass when ye be come to the land which the LORD will give you according as he hath promised that ye shall keep this service) (And it shall come to pass when your children shall say unto you What mean ye by this service? That ye shall say It is the sacrifice of the LORD’s passover who passed over the houses of the children of Israel in Egypt when he smote the Egyptians and delivered our houses And the people bowed the head and worshipped) (And the children of Israel went away and did as the LORD had commanded Moses and Aaron so did they) (And it came to pass that at midnight the LORD smote all the firstborn in the land of Egypt from the firstborn of Pharaoh that sat on his throne unto the firstborn of the captive that was in the dungeon and all the firstborn of cattle) (And Pharaoh rose up in the night he and all his servants and all the Egyptians and there was a great cry in Egypt for there was not a house where there was not one dead) (And he called for Moses and Aaron by night and said Rise up and get you forth from among my people both ye and the children of Israel and go serve the LORD as ye have said) (Also take your flocks and your herds as ye have said and be gone and bless me also) (And the Egyptians were urgent upon the people that they might send them out of the land in haste for they said We be all dead men) (And the people took their dough before it was leavened their kneadingtroughs being bound up in their clothes upon their shoulders) (And the children of Israel did according to the word of Moses and they borrowed of the Egyptians jewels of silver and jewels of gold and raiment And the LORD gave the people favour in the sight of the Egyptians so that they lent unto them such things as they required And they spoiled the Egyptians) (And the children of Israel journeyed from Rameses to Succoth about six hundred thousand on foot that were men beside children) (And a mixed multitude went up also with them and flocks and herds even very much cattle) (And they baked unleavened cakes of the dough which they brought forth out of Egypt for it was not leavened because they were thrust out of Egypt and could not tarry neither had they prepared for themselves any victual) (Now the sojourning of the children of Israel who dwelt in Egypt was four hundred and thirty years) (And it came to pass at the end of the four hundred and thirty years even the selfsame day it came to pass that all the hosts of the LORD went out from the land of Egypt) (It is a night to be much observed unto the LORD for bringing them out from the land of Egypt this is that night of the LORD to be observed of all the children of Israel in their generations) (And the LORD said unto Moses and Aaron This is the ordinance of the passover There shall no stranger eat thereof But every man’s servant that is bought for money when thou hast circumcised him then shall he eat thereof) (A foreigner and an hired servant shall not eat thereof) (In one house shall it be eaten thou shalt not carry forth ought of the flesh abroad out of the house neither shall ye break a bone thereof) (All the congregation of Israel shall keep it) (And when a stranger shall sojourn with thee and will keep the passover to the LORD let all his males be circumcised and then let him come near and keep it and he shall be as one that is born in the land for no uncircumcised person shall eat thereof) (One law shall be to him that is homeborn and unto the stranger that sojourneth among you) (Thus did all the children of Israel as the LORD commanded Moses and Aaron so did they) (And it came to pass the selfsame day that the LORD did bring the children of Israel out of the land of Egypt by their armies)))) (define EPILOGUE (symbols->strings '((You have reached the end of this introduction to computing and programming or program design as we say here) (While there is more to learn about both subjects this is a good point to stop summarize and look ahead) (In elementary school you learned to calculate with numbers) (At first you used numbers to count real things: three apples five friends twelve bagels) (A bit later you encountered addition subtraction multiplication and even division then came fractions) (Eventually you found out about variables and functions which your teachers called algebra) (Variables represented numbers and functions related numbers to numbers) (Because you used numbers throughout this process you didn’t think much of numbers as a means to represent information about the real world) (Yes you had started with three bears five wolves and twelve horses but by high school nobody reminded you of this relationship) (When you move from mathematical calculations to computing the step from information to data and back becomes central) (Nowadays programs process representations of music videos molecules chemical compounds business case studies electrical diagrams and blue prints) (Fortunately you don’t need to encode all this information with numbers or worse just 0 and 1 if you had to life would be unimaginably tedious) (Instead computing generalizes arithmetic and algebra so that when you program you can code—and your programs can compute—with strings Booleans characters structures lists functions and many more kinds of data) (Classes of data and their functions come with equational laws that explain their meaning just like the laws for numbers and their functions) (While these equational laws are as simple as + 1 1 evaluates to 2 and not true equals false you can use them to predict the behavior of entire programs) (When you run a program you really just apply one of its many functions an act that you can explain with the beta rule first mentioned in Intermezzo: BSL) (Once the variables are replaced with values the laws of data take over until you either have just a value or another function application) (But yes that’s all there is to computing) (A typical software development project requires the collaboration of many programmers and the result consists of thousands of functions) (Over the life span of such a project programmers come and go) (Hence the design structure of programs is really a means of communication among programmers across time) (When you approach code that someone else wrote some time ago the program ought to express its purpose and its relationships to other pieces—because that other person might not be around anymore) (In such a dynamic context programmers must create programs in a disciplined manner if they wish to work reasonable numbers of hours or produce high-quality products) (Following a systematic design method guarantees that the program organization is comprehensible) (Others can then easily understand the pieces and the whole and then fix bugs or add new pieces of functionality) (The design process of this book is one of these methods and you ought to follow it whenever you create programs you might care about) (You start with an analysis of the world of information and a description of the data that represent the information) (Then you make a plan a work list of functions needed) (If this list is large you refine the process in an iterative manner) (You start with a subset of functions that quickly yields a product with which a client can interact) (As you observe these interactions you will quickly figure out which elements of your work list to tackle next) (Designing a program or just a function requires a rigorous understanding of what it computes) (Unless you can describe the purpose of a piece of code with a concise statement you cannot produce anything useful for future programmers) (Make up and work through examples) (Turn these examples into a suite of tests) (This test suite is even more important when it comes to future modifications of the program) (Anyone who changes the code can re-run these tests and reconfirm that the program still works for the basic examples) (Eventually your program will also fail) (Other programmers may use it in an unanticipated manner) (Real-world users may find differences between expected and actual behavior) (Because you have designed the code in a systematic manner you will know what to do) (You will formulate a failing test case for your program’s main function) (From this one test you will derive a test case for each function that the main function mentions) (Those functions that pass their new tests do not contribute to the failure) (One of others does on occasion several might collude to create a bug) (If the broken function composes others resume the test creation otherwise you have found the source of the problem) (You will know that you have fixed the problem when the program as a whole passes all its tests) (No matter how hard you work a function or program isn’t done the first time it passes the test suite) (You must find time to inspect it for design flaws and repetitions of designs) (If you find any design patterns form new abstractions or use existing abstractions to eliminate these patterns) (If you respect these guidelines you will produce solid software within reasonable effort) (It will work because you understand why and how it works) (Others who must modify or enhance your software will understand it quickly because the code communicates its process and its purpose) (Working through this book got you started) (Now you must practice practice practice) (And you will have to learn a lot more about program design and computing than a first book can teach) (Right now you might be wondering what to study next) (The answer is both more programming and more computing) (As a student of program design your next task is to learn how the design process applies in the setting of a full-fledged programming language) (Some of these are like the teaching languages and the transition will be easy) (Others require a different mind set because they offer means for spelling out data definitions classes and objects and for formulating signatures so that they are cross-checked before the program is run types) (Given your knowledge it is easy for you to learn Racket the language behind the teaching languages in this book) (See Realm of Racket for one possible introduction) (In addition you will also have to learn how to scale the design process to the use and production of so-called frameworks stacks and components) (Roughly speaking frameworks abstract pieces of functionality—for example graphical user interfaces database connections and web connectivity—that are common to many software systems) (You need to learn to instantiate these abstractions and your programs will compose these instances to create coherent systems) (Similarly learning to create new system components is also inherently a part of scaling up your skills) (As a student of computing you will also have to expand your understanding of the computational process) (This book has focused on the laws that describe the process itself) (In order to function as a real software engineer you need to learn what the process costs both at a theoretical level and a practical one) (Studying the concept of big-O in some more depth is a first small step in this direction learning to measure and analyze a program’s performance is the real goal because you will need this skill as a developer on a regular basis) (Above and beyond these basic ideas you will also need knowledge about hardware networking layering of software and specialized algorithms in various disciplines) (Some of you wanted to see what computing and programming are all about) (You now know that computing is just a generalization of calculating and you may just sense how useful program design is to you) (Even if you never develop programs again you know what distinguishes a garage programmer from a serious software developer) (When you interact with developers as a professional you know that systematic design matters because it affects your quality of life and the bottom line of your business) (In reality though you are likely to program again on a regular basis you may just fail to see your activities in this light) (Imagine a journalist for a moment) (His story starts with the collection of information and data laying it out organizing it and adding anecdotes) (If you squint you’ll see that this is just step one of the design process) (Let’s turn to a family doctor who after checking up on your symptoms formulates a hypothesis of what might affect you) (Do you see step two? Or think of a lawyer who illustrates the point of her line of argument with a number of examples—an instance of step three) (Finally a civil engineer cross-checks the bridge as it is built to make sure it lives up to the blueprint and the underlying static calculations) (Cross-checking is just a form of testing—step six of the process it compares actual measurements with expected values from the predictive calculations) (Each of these professionals develops a system to work effectively and efficiently and deep down this system is likely to resemble the design process employed in this book) (Now once you accept that many activities are a form of programming you can transfer additional ideas from the design process to your own life) (For example if you recognize patterns you may take the little additional time it takes to create an abstraction—a single point of control—to simplify your future work) (So regardless of whether you become an accountant or a doctor or something else remember the design processes wherever you go and whatever you do)))) (provide THE-RAVEN AMERICAN-PIE SCARLET-LETTER TEN-PLAGUES EPILOGUE pair? pair-x pair-y make-pair get update-mapping)