From: Adam Michalik on 20 Oct 2009 12:37 Anti Vigilante <antivigilante(a)pyrabang.com> writes: > You know the irony of it all is that the fear of parens is caused by > countless times leaving out a ;, a ,, or a }. (intended (on (pun > punctuation). There is no syntax other than differentiation of symbols > and association of symbols into operations. > > The debate over infix versus prefix has some limited substance. On the > one hand all languages use prefix: function(arg, arg). The trouble is > the Yoda principle: > > Sometimes infix feels like Yoda: Have you ever seen this, "filename open > 'rw'" or "file transfer local from storage remote to storage"? > > If it were a network diagram it would almost make sense except local and > storage and remote and storage belong together. > > Other times prefix feels like Yoda: (with (cut ((the lieutenant) (his > (lieutenant chicken)) (and ((a knife) fork))) > > Funny way to say, "The lieutenant cut his chicken with a knife and > fork." > > Infix makes the object do the action (instead of you or the computer) > while prefix forces you to find the beginning of the sentence buried > somewhere in the middle. > > It's a wash. They both fail. I would say though that prefix usually gets > unscrambled as you stop looking at words as being important and allow > them to just be simple details. The clarity that emerges from crossing > that threshold is beyond the limits of stop and go driving offered by > infix. > > Granted, if we had one list per line and two newlines signified end of > list, the parens could go away as well. > > I tried to replace parens with a _#SPACE, #SPACE_ based read macro but I > couldn't figure out how to write the thing. > > Read macros are the machine language of lisp. (Eval is closer to > assembly). You can't test the macro half way through. You have to do > things in blocks of two: Take care of opening and closing or you will > have to start over from scratch. > When I was learning read macros and parsing, I've written a macro which translates foo(bar, baz).bax(xyzzy) to (bax (foo bar baz) xyzzy) When I showed it to a person who was unfamilar with Lisp, he said: "Oh, I did not know that Lisp is object oriented!" This's something Java taught the programming community - OOP is a dot after an expression. -- Adam Michalik vel Dodek Dodecki <dodek[]dodecki.net>
From: Aatu Koskensilta on 20 Oct 2009 12:36 Anti Vigilante <antivigilante(a)pyrabang.com> writes: > The debate over infix versus prefix has some limited substance. On the > one hand all languages use prefix: function(arg, arg). Yes, general function application is almost always written in prefix, but e.g. Agda allows mixfix syntax for user-defined functions, so that we can write, say, if_then_else_ : {A : Set} -> Bool -> A -> A -> A if true then x else y = x if false then x else y = y -- Aatu Koskensilta (aatu.koskensilta(a)uta.fi) "Wovon mann nicht sprechen kann, dar�ber muss man schweigen" - Ludwig Wittgenstein, Tractatus Logico-Philosophicus
From: vippstar on 20 Oct 2009 13:58 On Oct 20, 7:37 pm, Adam Michalik <dode...(a)gmail.com> wrote: <snip> > This's something Java taught the programming community - OOP is a dot > after an expression. If it weren't for Java, everyone would know programming.
From: Robert Uhl on 20 Oct 2009 15:42 vippstar <vippstar(a)gmail.com> writes: > > If it weren't for Java, everyone would know programming. If it weren't for Java, programs would be written. -- Robert A. Uhl Modern art is what happens when painters stop looking at girls and persuade themselves that they have a better idea. --John Ciardi
From: Kaz Kylheku on 20 Oct 2009 16:25 On 2009-10-20, Adam Michalik <dodecki(a)gmail.com> wrote: > This's something Java taught the programming community - OOP is a dot > after an expression. No; it's what Simula 67 taught the programming community. But not directly; it was the ghost of Simula 67, channeled by Stroustrup in the form of C++: [ Wikipedia Simula Example ] Begin Class Glyph; Virtual: Procedure print Is Procedure print;; Begin End; Glyph Class Char (c); Character c; Begin Procedure print; OutChar(c); End; Glyph Class Line (elements); Ref (Glyph) Array elements; Begin Procedure print; Begin Integer i; For i:= 1 Step 1 Until UpperBound (elements, 1) Do elements (i).print; OutImage; End; End; Ref (Glyph) rg; Ref (Glyph) Array rgs (1 : 4); ! Main program; rgs (1):- New Char ('A'); rgs (2):- New Char ('b'); rgs (3):- New Char ('b'); rgs (4):- New Char ('a'); rg:- New Line (rgs); rg.print; End; Look, construction with new, virtual functions, obj.member_function syntax. Now Java was introduced as a dumbed down C++ for those who can't handle the read thing.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: The history of multimethods Next: Error when install the Lispbox on Ubuntu |