Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Kazimir Majorinc

#21
Not a big deal, but upper-case?, lower-case? and title-case? are consistent with other predicates, and low hanging opportunity for slightly shorter and faster code. It might be that many persistent Newlispers miss these, although only occasionally. More generally, maybe some other single variable functions (like unique, sort) deserve their predicates defined as f|->(= x (f x)) .
#22
newLISP in the real world / Error report: unify and '
January 27, 2011, 08:49:54 AM
> (unify '((quote X) (quote Y) (quote Z)) '((quote (a a)) (quote (b b)) (quote (c c))))
((X (a a)) (Y (b b)) (Z (c c)))
> (unify '('X 'Y 'Z) '('(a a) '(b b) '(c c)))
nil
>
#24
http://www.instprog.com//blogposts/enumeration-of-lambda-expressions/million-lambda-expressions.txt">http://www.instprog.com//blogposts/enum ... ssions.txt">http://www.instprog.com//blogposts/enumeration-of-lambda-expressions/million-lambda-expressions.txt
#25
http://img836.imageshack.us/img836/9346/33o7gph.gif">
#26
Currently three short movies from Michael Michaels -- "neglOOk"


[*]http://www.youtube.com/watch?v=dr0LsYj8fWY">The Exclamation Point
  • [*]http://www.youtube.com/watch?v=fPzoCM4miO4">Dollar-Sign Episode

  • [*]http://www.youtube.com/watch?v=bPtMZJXruxw">Plus-Minus-Multiply-Divide-Modulo
  • [/list]
    #27
    Some operations defined for lists and strings can be extended on symbols. For example



    (append 'x 'y) => xy

    (chop 'zonk) => zon



    also rest, find etc. Arguments pro]
  • [*]some programs can be both shorter and at least slightly faster: (append x0 y0) instead (sym (append (string x0) (string y0))),

  • [*]treatment of symbols as data seems to be in spirit of Lisp,

  • [*]as current behaviour is erroneous, proposed extension should be safe, except for programs relying on (throw-error (append 'x 'y)).
  • [/list]



    Example of the code](setf CR (lambda(x)x))
    (setf CAR first CDR rest L '(CAR CDR))

    (do-while(< counter 1024)
        (setf s (pop L))
        (dolist(i '(CAR CDR))
          (set 's0 (sym (append (chop (string i)) (rest (string s)))))
          (set s0 (expand (lambda(x)(i (s x))) 's 'i))
          (println (inc counter) ". " s0 "=" (eval s0))
          (push s0 L -1)))[/code]



    If I proposed it already, sorry.
    #28
    X=NIL; (dotform X)=NIL; (listform X)=();

    X=(); (dotform X)=NIL; (listform X)=();

    X=(()); (dotform X)=(NIL . NIL); (listform X)=(());

    X=(NIL); (dotform X)=(NIL . NIL); (listform X)=(());

    X=((NIL)); (dotform X)=((NIL . NIL) . NIL); (listform X)=((()));

    X=(NIL . (NIL . NIL)); (dotform X)=(NIL . (NIL . NIL)); (listform X)=(() ());

    X=((NIL . NIL) . NIL); (dotform X)=((NIL . NIL) . NIL); (listform X)=((()));

    X=((A . NIL) . (B . NIL)); (dotform X)=((A . NIL) . (B . NIL)); (listform X)=((A) B);

    X=(A); (dotform X)=(A . NIL); (listform X)=(A);

    X=(A . B); (dotform X)=(A . B); (listform X)=(A . B);

    X=(() . ()); (dotform X)=(NIL . NIL); (listform X)=(());

    X=(B . (C)); (dotform X)=(B . (C . NIL)); (listform X)=(B C);

    X=(A B C); (dotform X)=(A . (B . (C . NIL))); (listform X)=(A B C);




    (it is about other Lisps, it has no sense in Newlisp I think.)
    #30
    I noticed following behaviour of the random primitive.


    > (dotimes(i 200000)(let((r (random)))(unless (and (< 0 r) (< r 1))(println "edge " (inc counter) ". " r))))
    edge 1. 1
    edge 2. 1
    edge 3. 0
    edge 4. 1
    edge 5. 1
    edge 6. 1
    edge 7. 0
    edge 8. 1
    edge 9. 0
    edge 10. 1
    edge 11. 0
    true


    The first surprise is that edge cases happen - but OK, it is matter of design; I don't know is it mentioned in manual. Other surprise is that edge cases happen roughly once in 16384 times and that might be too frequent - if random returns some ten significant digits.
    #31
    Anything else we might add? / New Newlisp forum.
    June 19, 2010, 12:51:49 AM
    http://www.vuvuzela-time.co.uk/newlispfanclub.alh.net/forum/">http://www.vuvuzela-time.co.uk/newlispf ... net/forum/">http://www.vuvuzela-time.co.uk/newlispfanclub.alh.net/forum/



    http://www.vuvuzela-time.co.uk/www.newlisp.org">http://www.vuvuzela-time.co.uk/www.newlisp.org
    #32
    (1) If symbols, for example, F are used in code, but they are not in symbol-table, their value is currently initalized to NIL. I propose generalization, so the symbol F is initialized to (INIT F), where INIT is user defined function or macro - if such is defined. If not, then NIL. On that way, one can define, for example


    [*] infinitely many binary numbers b0101, b0001110, b00101010 ....
  • [*] infinite family of functions car, cdr, caar, cadar, ...
  • [/list]




    I do not really know is it good or not, because it complicates the semantics of the language. However, it is already practised - for example, for representation of numbers. Otherwise, one should write something like (set '135 (decimal '1 '3 '5)), (set '0x124 (hex '1 2 4)) before using these. It begs the question - if built-in, why not user-defined as well? Finally, proposed change is not risky, because current behaviour can stay as default, and change only if one explicitly define INIT.





    (2) Currently, if F0 evaluates to F1, F1 evaluates to F2, ..., F10 evaluates to (lambda(x)(x+3)) then



    (F0 4) [/list]




    returns an error, and I'd like it to return 7. Unlike for previous example, I am pretty sure it would be sound extension, but its harder to find example. Nevertheless, as it is to replace currently erroneous behaviour, it cannot be harmful.[/color]
    #33
    I'll give a public lecture titled



    http://www.instprog.com/blogposts/Hacklab/Hacklab.jpg">http://www.instprog.com/blogposts/Hacklab/Hacklab.jpg[/img]
    #34


    #35
    http://speely.wordpress.com/2010/02/27/introducing-zep/">http://speely.wordpress.com/2010/02/27/introducing-zep/

    http://www.yellosoft.us/zep">http://www.yellosoft.us/zep
    #36
    Anything else we might add? / Steampunk Dragonfly
    February 25, 2010, 06:55:59 PM
    http://mykeamend.com/new/wp-content/uploads/2009/03/myke_amend_conception_desktop_1280x1024.png">http://mykeamend.com/new/wp-content/upl ... 0x1024.png">http://mykeamend.com/new/wp-content/uploads/2009/03/myke_amend_conception_desktop_1280x1024.png
    #37
    So, what can you actually DO with newLISP? / Joh's blog
    February 24, 2010, 05:44:52 PM
    http://johu02.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&_c=BlogPart&partqs=cat%3DLISP">http://johu02.spaces.live.com/?_c11_Blo ... cat%3dLISP">http://johu02.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&_c=BlogPart&partqs=cat%3dLISP
    #38
    http://2bbie.wordpress.com/2010/02/24/new-en-newlisp-parte1/">http://2bbie.wordpress.com/2010/02/24/n ... sp-parte1/">http://2bbie.wordpress.com/2010/02/24/new-en-newlisp-parte1/
    #39
    Original:



    http://www.moongift.jp/2010/02/newlips/">http://www.moongift.jp/2010/02/newlips/



    Google translated on English:



    http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http%3A%2F%2Fwww.moongift.jp%2F2010%2F02%2Fnewlips%2F&sl=ja&tl=en">http://translate.google.com/translate?j ... l=ja&tl=en">http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http%3A%2F%2Fwww.moongift.jp%2F2010%2F02%2Fnewlips%2F&sl=ja&tl=en
    #40
    Whither newLISP? / ends-with
    February 12, 2010, 01:52:59 PM
    currently]