+
2
|
skin
|
login
|
edit
{λ way}
::
quick
user:anonymous
{style °° @import url(https://fonts.googleapis.com/css?family=Quicksand); body { font-family:"quicksand"; } °°} {center _h2 quick1 | [[quick2]] | [[quick3]]} {hr} _p {b Foreword:} You don't like Ava Gardner? You want a more serious introduction? Please have a look to [[quick2]] or [[quick3]], and then to [[lambdatalk three]] and later to [[calc2talk]]. {hr} _p The {b lambdaway} project comes with a sheet of paper and a pencil - a wiki called {b lambdatank} and a language called {b lambdatalk} - with which you can create and share rich and interactive documents on the web! _p It begins with simple things, for instance you could simply write {div {@ style="text-align:center; font:normal 10em quicksand; color:#888;"} '{ava}} _p and get a picture of the gorgious {b Ava Gardner} {ava} _p Amazing isnt'it? {i Cette femme a de si beaux yeux !} Let's begin with simple things! {TITRE 2em 1} {{PRE} '{b Hello {sup brave {sup new {sup World! }}}} -> {b Hello {sup brave {sup new {sup World!}}}} } _p You are entering the marvelous world of nested tree structures. {TITRE 2em 2} {{PRE} √( 3'{sup 2} + 4'{sup 2} ) = '{sqrt {+ {* 3 3} {* 4 4}}} -> √( 3{sup 2} + 4{sup 2} ) = {sqrt {+ {* 3 3} {* 4 4}}} } _ul {code √(3{sup 2}+4{sup 2})} is familiar to mathematicians and comes from the history of mathematics with a lot of specific notations, prefix [{code √}], infix [{code +}], exposant [{code x{sup 2}}]. _ul {code '{sqrt {+ {* 3 3} {* 4 4}}}} uses a nested syntax embedded in curly braces making it unfamiliar to anybody. But wait, this syntax is coherent, unique, systematic and so, becomes universal. Everything can be written following this simple syntax, styling text, computing numbers, coding functions and this "{b stenography}" will quickly become more familiar. Read this expression like this "{i the square root of the sum of the product of 3 by 3 and of the product of 4 by 4}" and you will be convinced... {TITRE 2em 3} {{PRE} '{def 345 {sqrt {+ {* 3 3} {* 4 4}}}} -> {def 345 {sqrt {+ {* 3 3} {* 4 4}}}} '{345} -> {345} } _p Thanks to Pythagoras, {b 5} is the hypotenuse of a right angle triangle [3,4]. {TITRE 2em 4} {{PRE} '{def hypo {lambda {:a :b} {sqrt {+ {* :a :a} {* :b :b}}} }} -> {def hypo {lambda {:a :b} {sqrt {+ {* :a :a} {* :b :b}}} }} '{hypo 3 4} -> {hypo 3 4} '{hypo 1 1} -> {hypo 1 1} } _p Pythagoras didn't like the last result! {TITRE 2em 5} {{PRE} '{def add {lambda {:a :b} {u :a+:b {sup is equal to} {b {+ :a :b}}}}} -> {def add {lambda {:a :b} {u :a+:b {sup is equal to} {b {+ :a :b}}}}} '{add 3 4} -> {add 3 4} } _p You might compare with a similar C or Javascript {i noodle} code... {TITRE 2em 6} {{PRE} '{img {@ src="data/amelie_poulain.jpg" width="98%" style=" padding: 5px 5px 35px 5px; border: 1px solid white; box-shadow: 0 0 8px black;" }} {img {@ src="data/amelie_poulain.jpg" width="98%" style="padding:5px 5px 35px 5px; border:1px white; box-shadow:0 0 8px black"}} } _p Amélie Poulain is nice but the code is ugly. Hey man, this is what web designers use to write, and so you will be able to ask them to help you styling your documents. And later some friendly coder will hide that stuff under a name. Let's see. {TITRE 2em 7} {{PRE} '{def ava {img {@ src="data/ava_gardner.jpg" width="98%" style=" padding: 5px 5px 35px 5px; border: 1px solid white; box-shadow: 0 0 8px black" }}} -> {def ava {img {@ src="data/ava_gardner.jpg" width="98%" style="padding:5px 5px 35px 5px; border:1px white; box-shadow:0 0 8px black" }}} '{ava} {ava} } _p Now you know what is hidden behind the call {code '{ava}}! {TITRE 2em 8} {{PRE} '{def fibonacci {def fibonacci.rec {lambda {:a :b :c} {if {< :c 1} then :a else {fibonacci.rec :b {+ :a :b} {- :c 1} } }}} {lambda {:n} {fibonacci.rec 0 1 :n} }} -> {def fibonacci {def fibonacci.rec {lambda {:a :b :i} {if {< :i 1} then :a else {fibonacci.rec :b {+ :a :b} {- :i 1}} }}} {lambda {:n} {fibonacci.rec 0 1 :n}}} '{fibonacci 75} -> {fibonacci 75} '{map fibonacci {serie 0 30}} -> {map fibonacci {serie 0 30}} } _p You will have noticed that the ratio of the last two Fibonacci's numbers, {code '{/ 832040 514229} = {/ 832040 514229}} is very closed to the Golden Ratio, {code Φ = '{/ {+ 1 {sqrt 5}} 2} = {/ {+ 1 {sqrt 5}} 2}}. Yes, you can play with maths, lambdatalk is fast enough! {TITRE 2em 9} _p You can do much more with lambdatalk. Have a look in the examples shown in this wiki, lambdatank, beginning with this quick [[overview]]. Follow the {b KISS} attitude: {b Keep It Small and Simple}. Feel free to write what you think. Later you will be able to enrich your documents by yourself or with the little help of a cute web designer and a smart coder. Your documents will remain easy to read, easy to edit and share. You will use nothing but standard HTML/CSS, standard maths, standard words for coding unified under a coherent syntax coming from the {b Lisp} world. And it's open source, it's free, it's not a jail. Your documents and the tools to create them are sustainable, lifelong, even if you leave the lambda way. _p Meanwhile, you are welcome in the {b lambdaway}! _p {i Alain Marty 2016/07/25 - updated on 2016/08/07} {{hide} {def T1.en styling text} {def T1.fr appliquer un style à un texte} {def T2.en computing a math expression} {def T2.fr calculer une expression mathématique} {def T3.en giving a name to a math expression} {def T3.fr donner un nom à une expression mathématique} {def T4.en giving a name to a function} {def T4.fr donner un nom à une fonction} {def T5.en mixing text and numbers} {def T5.fr mélanger des textes et des nombres} {def T6.en using HTML/CSS} {def T6.fr utiliser HTML/CSS} {def T7.en hiding that stuff under a name} {def T7.fr cacher tout çà sous un nom} {def T8.en fast computing Fibonacci's numbers} {def T8.fr calculer rapidement les nombres de Fibonacci} {def T9.en and so on ...} {def T9.fr et ainsi de suite ...} } {{hide} {def PRE pre {@ style="font:normal 2.1em quicksand, optima; white-space:pre-wrap;"}} {def TITRE {lambda {:s :i} {div {@ style="font:bold :s quicksand, optima; margin-left:20px; margin-bottom:-20px" onMouseOver = "this.childNodes[1].style.visibility = 'visible';" onMouseOut = "this.childNodes[1].style.visibility = 'hidden';" } :i. {T:i.en} {div {@ style="visibility:hidden; font:normal 16px courier; color:black; background:#ffc; opacity:0.8; position:relative; top:-10px; left:0px;" } {T:i.fr}} }}} }