2010-12-25

emacs delete-selection property

2010-12-25

http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/cd99a3244258f58e#

> > Hope this helps, Ilya
>
> Hope it helped you.  I have my doubts that it helped anyone else.

lol. funny. I see a flamewar brewing, and am getting into the fray here by participating.

I think both Drew and Llya or even me adds good points in the discussion.

The way i see this is a bug is in the sense that the purpose of delete-selection property seems to be thwarted by specific way how emacs works. Namely, the final effect is that it makes a distinction on whether the command is invoked by M-x or by a hotkey.

so, i tend to see this is not a desired behavior (call it “bug” or “feature” or “design” or whatnot).

but overall i guess this is trivial? It would be fruitful if someone do a survey on how many functions actually use the delete-selection property, or if some emacs oldbie can tell us that property's history. Am guessing, these days, if elisp programer want the behavior of deleting existing text selection in commands they write, a reliable and easy and explicit way is simply to put in the code

  (when (region-active-p)
    (delete-region (region-beginning) (region-end) )
    )

instead of relying on delete-region property. I think elisp function property is rather esoteric (e.g. it is not a feature in most langs, and i don't think it is that much widely known or used in elisp) I think i learned about it when diddling with cua-mode around 2007. The fact i learned it i think introduced more trouble, because otherwise i'd put the explicit code above and i wouldn't have posted this or the bug report. (does anyone know a list of all built-in lisp properties? (havn't spend any effort to search the manual...))

i think a good question is: from a core emacs developer's point of view (such as Richard Stallman, or perhaps Drew Adamns and Llya Z. who designed the system or know the core system well), would you advice to actually make use of the delete-selection proprety or just use the explicit code above?

Xah

2010-12-23

emacs delete-selection property

http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/cd99a3244258f58e/8ee411d570ff0ef3

---------- Forwarded message ----------
From: Xah Lee
Date: Dec 22, 6:33 pm
Subject: can a command specify overwrite selection behavior?
To: gnu.emacs.help


On Dec 22, 9:12 am, "Drew Adams" wrote:

> > Drew, what i didn't understand is why the insert-date property makes a
> > distinction on whether a command is called by name or by a keyboard
> > shortcut?

> Ah, good question.  Here's the answer:

> (defun delete-selection-pre-hook ()
>   (when (and delete-selection-mode
>              transient-mark-mode mark-active
>                (not buffer-read-only))
>     (let ((type (and (symbolp this-command)
>                          (get this-command ; <=======
>                           'delete-selection))))

> If you debug this (use `message', not `debug-on-entry'!), you'll see that when
> you use `M-x' the value of `this-command' is `execute-extended-command', not
> `insert-date'.  And `execute-extended-command' does not have a non-nil
> `delete-selection' property.

> `execute-extended-command' is a bit special wrt `this-command' and
> `last-command'.  It DTRT in the end, essentially removing itself from the party,
> but that's only at the end.  While `execute-extended-command' is executing, it
> is the value of `this-command'.

> People sometimes get thrown off by this kind of thing, and similar things wrt
> `M-:' (and `C-x C-e', `C-M-x'...).

> The thing to remember is that `M-x' and `M-:' are themselves keys that are bound
> to commands, and that even though they invoke or evaluate other stuff (and that
> other stuff is what we focus on), that is not the same as just invoking or
> evaluating the other stuff directly.  They add their bit to the mix, and
> sometimes that makes a difference.

> It can help to remember that EVERYTHING in Emacs is a COMMAND.  Or, rather,
> every user interaction is via a command.  Outside Emacs we are not used to
> thinking that way (because outside Emacs it is not true).  But even when you hit
> a letter key such as `g' Emacs invokes a command (by default,
> `self-insert-command').

> Always.  Well no, you can undefine keys: (global-unset-key "a") etc., but as a
> general rule it is true.

> (I know that you know all of this, but I find it's worth reminding myself from
> time to time.  Emacs interaction is all about commands.)

hi Drew. Very useful info i do not know about. Thanks.

 Xah

2010-12-08

unicode and LaTeX abbrevs list

http://stackoverflow.com/questions/4392668/list-of-latex-math-symbol-abbrevs-together-with-unicode-char

does anyone know a page that list all TeX/LaTeX's math symbols abbrevation together with a unicode character?

i need the glyph to be unicode char, not a image.

i spent 20 min but couldn't find it.

closest i found is http://ia.wikipedia.org/wiki/Wikipedia:LaTeX_symbols
but it uses images. If it uses unicode char, that'd be perfect.

2010-12-06

Mathematica aliases for special chars

there's this page listing all named chars in Mathematica
http://reference.wolfram.com/mathematica/guide/ListingOfNamedCharacters.html

is there a page listing all possible input alias for a special symbol?

(also including TeX abbrevs, e.g. Esc \forall Esc)

i searched the doc for a while but couldn't find it.

(i know that any named char can be input like \[Name] and unicode can be input like \:nnnn. Am interested in the special aliases)

programmatically getting the list also welcome. Thanks.

Xah ∑ http://xahlee.org/ ☄

2010-12-04

xah lee, sexual harassment

2010-12-04

> On Dec 3, 8:20 pm, duckblue wrote:
> > why is xah lee posting this information?
>
> > sites with more external links pointing to them are given a higher
> > ranking by search engines such as google. as a result they appear
> > closer to the top of the search engine results pages ('SERPs' in SEO
> > lingo).
> > xah's posting here is part of active an SEO campaign that he is
> > carrying out in order bring traffic to his site.- Hide quoted text -

On Dec 3, 9:16 pm, small Pox wrote:
> Xah Lee writes good articles. She has a helpful attitude. Do you want
> her to become so financially dependent like that innocent looking
> rabbit teeth Adelyn Lee so she become a prostitute of Larry Ellis
> Islander who has gobbled up Sun, mysql, cray and so many software and
> hardware companies to make the largest and possibly going to be a most
> evil monopoly on earth ?

thanks.

interesting mention about Adelyn Lee.

I looked up,

〈Woman Who Accused Oracle Chief Guilty of Perjury〉 January 29, 1997, By Benjamin Pimentel, Chronicle Peninsula Bureau. SFGate Articles.
〔 http://articles.sfgate.com/1997-01-29/news/17741019_1_mr-ellison-adelyn-lee-e-mail 〕

Quote:

«A San Mateo woman accused of forging e-mail to sue Oracle Corp. was found guilty yesterday of perjury and falsification of evidence.»

«Adelyn Lee, a 33-year-old former girlfriend of Oracle Chief Executive Officer Larry Ellison, was convicted by a San Mateo County jury, ending a Silicon Valley soap opera that revealed some of the inner workings of the world's second-largest software company. »

«In 1995, Lee won a $100,000 settlement of a wrongful termination suit in which she claimed that she was fired from her job as an executive assistant after she refused to have sex with Ellison. »

interesting. Yeah, the 1990s, everything is sexual harassment.

it so happpens, i have a story to tell as well. I was officially accused of sexual harassment in around 2000 while working at Netopia. The whole case is ridiculous. The woman who accused me, was romantically interested in me. She's got some personal psychological problems. We both are sys admins (but i also do dev). She lives and work at the Kansas branch, while i work in California. Once or twice a year, the company has her flew over for business, typically lasting just a day. I'm not her superior or vice versa. Our relationship started when she started to IM me and got me to use AOL. The AOL chat is kinda used for business discussions as well, since it's just convenient, and apparantly it became popular in the company. (remember, this is 1999.) When she came over, i think the second time, then later, she filed a sexual harassment to Netopia. (i didn't even know before) We did not sleep together. The closest physical contact might be holding hands, which, i don't remember we actually did. All i know after the whole thing is that she's got some kinda love hang-over.

At the end, they (the human resource woman who handles this) ask me to sign a paper, which, if i recall correctly, basically want me to admit some wrong doing or something like that. I do not agree to it, i refused to sign. And that basically is the end of it. She quit or was fired sometimes later on (don't think it has anything to do with this). I was laid off in 2002. (Netopia got bought by Motorola in ~2005)

I may write up a blog, with full disclosure of all documents of the case and emails sometimes later.

Xah

2010-12-01

list processing: mathematica vs lisp

in lisp lang, often there's pure exercise posted about manipulating lists.

here's a old Mathematica post that Google recently dig'd up and notified me (apparantly, it means people's been reading that post)

http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/72a9cf0ac76e7698/1234f5dd46b5e58e?lnk=gst&q=villegas

i hope that in this post, if anything, it gives lispers some idea about how Mathematica is similar to lisp, and if i may say so, how Mathematica is some order of magnitude easier to do complex list manipulation problems than lisps.

(me, being a Mathematica fan, like to say this. Of course, this does not mean Mathematica is “better” for everything. But take what you will.)

for list manipulation, i think langs that might be comparable to Mathematica's capabilities are those so-called array programing langs. (e.g. APL. see http://en.wikipedia.org/wiki/Array_programming )

when i first ventured into lisp in ~1999 (or any lang other than Mathematica), i was naive and was rather surprised that in lisp, list structure programing is not much done at all (in comparison to my experiences with Mathematica) Then in around 2004, i was naively surprised that even in Haskell, there's even no default data type of nested list. (i was naive because i thought every functional lang relies on arbitrarily nested list as its main data structure. But with about 10 years of industrial programing experience now, i think hardly any programing or lang relies on nested list as its main data structure. At most, there's just 2 or 3 levels of nesting as in matrices.)

the post is pasted in the following:
-----------------------------------------

From: Xah Y Lee
Date: Apr 7 1995, 11:00 pm
Subject: Summary:Ways to get Odd Columns&Rows of Matrix
To: comp.soft-sys.math.mathematica


This is a summary of Ways to get only odd rows and columns of a matrix.

Problem: Suppose we have a mxn matrix. We want to cross out the even rows
and columns, and get the remaining matrix. How to do that?

This is built-in in mma. The simplest way to do it is
Part[myMatrix,{1,3,5...},{1,3,5...}]. See section 3.7.2, p.651 of the mma
book.

Below is a collection of various ways to write this program. Some of them
are general that can work on matrices with more than 2 dimensions, and
user can choose odd only, even only, or generalized such as every third
member in the tensor. Most others are included not as a practical solution but
as programming examples.

These pieces of codes are contributed by various members of mathgroup.
I've taken the liberty to modify some of them to make this a coherent
summary.

------------
Clear[myList]
myList = Array[a,{10,18}];
------------
(*Using Part*)
(*From: Robert Villegas *)
(*From: Count Dracula *)
(*
In my opinion this is the best solution.
Use Map[Select[Range[#], OddQ] &, Dimensions[myMatrix]] to generate a
list {{1,3,5,..}, {1,3,5,7...}}, then feed it to Part to extract, like
this
Part[myMatrix, {1,3,5}, {1,3,5,7}].*)
*)

MatrixSieve1a[myMatrix_] :=
   Part[myMatrix,
      Sequence@@ Map[ Range[1, #, 2]&, Dimensions[myMatrix]]
   ]

MatrixSieve1b[myMatrix_, sel_:OddQ] :=
   Part[myMatrix,
      Sequence@@ Map[(Select[Range[#], sel] &) , Dimensions[myMatrix]]
   ]

------------
(*Using Table.*)
(*From: Lou Talman *)
(*easiest to understand.*)

MatrixSieve2[myMatrix_] :=
   Module[{i,j},
      Table[ myMatrix[[i, j]],
         {i, 1, Length[myMatrix], 2},
         {j, 1, Length[First@myMatrix], 2}
      ]
   ]
------------
(*using Partition. *)
(*From: Xah Lee <74631....@compuserve.com>*)
(*
This one is hard to understand. It's not easy to generalize as well. It
will not work if the matrix contain odd number of row or column, but it's
got the potential to become the most elegant solution. It's the fastest
among all.
*)
MatrixSieve3[myMatrix_] := Map[ First, Partition[myMatrix,{2,2}],{2,3}]

------------
(*Recursively elimate the second term.*)
(*From: Tyler Perkins *)
(*
Define OddOnly[], that will get rid of the second element in a list.
This is repeated recursively in a nested way so that at the end only the
odd terms of the list is left.
Map OddOnly to every level of myList.
*)

OddOnly[{first_, second_, rest___}] := Join[{first}, OddOnly[{rest}]];
OddOnly[singleExpr_] := singleExpr;
MatrixSieve4[myMatrix_] := MapAll[ OddOnly, myMatrix]

------------
(*using Array and Part*)
(*From: "L. Hannibal" *)

MatrixSieve5[myMatrix_]:=
   Array[
      myMatrix[[2 #1 -1,2 #2-1]]&,
         {Ceiling[Length[myMatrix]/2], Ceiling[Length@First@myMatrix/2]}
   ]
------------
(*using Pattern and ReplaceRepeated*)
(*From: Robert Zimmerman *)
(*This is not a general method, but included here as a extra example of
programming techniques. It only works on matrices whos elements have the
form head[x,y]. It works by first flatten myList, then replace elements
with even index with 0, then eliminate the zeros in the list. Lastly,
Partition them into the correct form.
*)
Partition[
   (Flatten@myList)//.{a[x_  ,y_?EvenQ ] ->0, a[x_?EvenQ  ,y_ ] ->0}//.
   { head___ ,0, tail___ } :> {head, tail}
   ,3
]
------------
(* using Fold and Drop *)
(*From: bob Hanlon *)
(*works on matrices with even number of terms.
Not a good example of coding.
The use of Fold, Transpose and Drop are too complex.
Slow as well.
*)

Transpose[
   Fold[ Drop,
      Transpose[
         Fold[ Drop, myList,
            -Array[List,Length@myList/2]
         ]
      ],
      -Array[List,Length@First@myList/2]
   ]
]
------------

 Xah Lee

svn rename letter case issue

a quick web search indicates that renaming files with only letter case changes on Windows client is a known issue.

See:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-rename.html
http://tortoisesvn.net/node/285
http://stackoverflow.com/questions/1225993/svn-rename-problem

the solution seems require editing the repository data, quote:

“Rename the file from UPPERcase to upperCASE directly in the repository using the repository browser. ”

anyone know how that's done?

Xah

On Dec 1, 2:21 am, Xah Lee wrote:
> Thanks bohuslav.krivosik.
>
> does anyone know if svn can properly rename the same file with just
> letter case difference?
>
> i cluelessly tried a combination of
> svn rm Tabbar.el
> svn add tabbar.el
> svn commit tabbar.el
> svn rename Tabbar.el tabbar.el
>
> in random order over the past few days...
>
> the repository shown on Google sitehttp://code.google.com/p/ergoemacs/source/browse/#svn/trunk/packages
> seems to still have cap letter version.
>
> i think i can solve one way or another by some brute force, but wonder
> if svn is capable of renaming file just for letter case changes.
>
> (same issue for twit.el)
>
> -------------------------
>
> a separate issue/question, is whether emacs packages should have cap
> letters. From my experience, the answer is no by convention. If that
> is correct, this means we also need to change the comment in the
> package's header so that the file name is lower case.
>
> e.g. the first line in twit.el content is this
> ;;; Twit.el --- interface with twitter.com
> it should be lower case too.
>
>  Xah
>
> On Nov 23, 3:30 am, ergoem...@googlecode.com wrote:
>
>
>
>
>
>
>
> > Status: New
> > Owner: ----
> > Labels: Type-Defect Priority-Medium
>
> > New issue 89 by bohuslav.krivosik: Wrong filename: Tabbar.elhttp://code.google.com/p/ergoemacs/issues/detail?id=89
>
> > Emacs version: 23.2.1
> > Ergoemacs version: 1.9.1.
> > OS: Linux Ubuntu
>
> > Install ergoemacs. Run emacs.
> > Emacs will start with following error message:
>
> > "File error: Cannot open load file, tabbar"
>
> > How to fix this bug:
> > Rename file "packages/Tabbar.el" to "packages/tabbar.el" (linux is  
> > case-sensitive)
>
> > Is there same problem for file Twit.el ?

2010-11-30

svn: local edit, incoming delete upon update

http://stackoverflow.com/users/369203/xah-lee
http://groups.google.com/group/ergoemacs/browse_frm/thread/e798dcbb9cd9e3b6

when i do a “svn status .”, i get this:

! C auto-complete-config.elc
> local edit, incoming delete upon update
! + C auto-complete.elc
> local edit, incoming delete upon update
! + C popup.elc
> local edit, incoming delete upon update
! + C fuzzy.elc
> local edit, incoming delete upon update


basically, these files shouldn't be in the repository. A developer has removed them. Then, i think i did a “svn rm ...” after the fact by mistake (should've done “svn update .” instead).

So now, when i do “svn status .”, i get these tree conflict messages.

I found the doc here http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-conflicts.html
but not sure how to “merge” it according to the doc.

how to get rid of them?

i think my working copy is in sync with the repository. Don't know why these messages shows. These files should be removed and are removed as far as i know everywhere. I tried “svn update .” and “svn revert .” but i still get this message when i do “svn status .”.

------------------------


On Nov 30, 3:57 pm, David Capello wrote:
> Hi Xah, maybe you can do
>
> svn revert auto-complete-config.elc
> svn revert auto-complete.elc
> svn revert popup.elc
> svn revert fuzzy.elc
>
> inside the auto-complete directory. And
> then svn update

i tried
svn revert .
before but that didn't work. Haven't tried revert on each file.

someone on stackoverflow
http://stackoverflow.com/questions/4317973/svn-how-to-resolve-local-edit-incoming-delete-upon-update-message
suggested this:

svn resolve --accept working

but that didn't work for me neither. I think maybe i did some combination of “svn rm” or delete the file in my working copy manually or something that screwed up the tree data.

in the end i just deleted the parent dir and did a update. That solves it. A simple solution i haven't thought of before.

thanks David.

Xah

unix date util in emacs shell problem

http://stackoverflow.com/questions/4313914/problem-with-unix-date-util-running-in-emacs-shell

here's a oddity.

on Cygwin bash on Windows Vista, i can get date like this:

$ date
2010-11-30 4:40:48 AM PST

xah@xah-PC ~
$ date +%s
1291120855

but in emacs “shell”, running the same date command, i get this:

c:\Users\xah\web\xahlee_org\comp>which date
which date
/usr/bin/date

c:\Users\xah\web\xahlee_org\comp>date
date
The current date is: 2010-11-30
Enter the new date: (yy-mm-dd)


c:\Users\xah\web\xahlee_org\comp>date +%s
date +%s
The system cannot accept the date entered.
Enter the new date: (yy-mm-dd)

any idea what's going on?

2010-11-23

new ergonomic keyboards

On Nov 23, 10:33 pm, Xah Lee wrote:
> i'm sorry to say, but when i read almost anything by programers about
> keyboarding, keybinding, in the past 10 years, 99% of them are purely
> idiotic to the extreme. I used harsh terms because the more i studied
> keyboard and all related issues, the more i see how extremely idiotic
> these opinions are.
>
> Here's some examples:
>
> • best way to avoid rsi is never to learn touch type. (expressed by
> Stephan Monnier (emacs maintainer), as well as keyboard maestro's
> author.)
>
> • the swapping of Caps Lock and Ctrl on a normal standard keyboard is
> good idea. Expressed by many.
>
> • emacs's keybinding is efficient.
>
> for 70 articles on Keyboards, Layouts, Hotkeys, Macros, RSI, typing
> habits, see:
>  http://xahlee.org/Periodic_dosage_dir/keyboarding.html
>
>  Xah

was quickly written, but forgot some more points. More examples with my answers:

• best way to avoid rsi is never to learn touch type. (expressed by Stephan Monnier (emacs maintainer), as well as keyboard maestro's author.)

the opinion by Stephan can be seen on comp.emacs sometimes in 2010 i think.

the one expressed by keyboard maestro's author Peter N Lewis is at http://xahlee.blogspot.com/2010/08/left-wrist-motion-pain-vi-esc-syndrome.html

and this opinion can sometimes be seen elsewhere on forums.

• the swapping of Caps Lock and Ctrl on a normal standard keyboard is
good idea. Expressed by many.

See 〈Why You Should Not Swap Caps Lock With Control〉 http://xahlee.org/emacs/swap_CapsLock_Ctrl.html

• emacs's keybinding is efficient.

See: 〈Why Emacs's Keyboard Shortcuts Are Painful〉 http://xahlee.org/emacs/emacs_kb_shortcuts_pain.html

• Happy Hacker keyboard is a fantastic keyboard. (expressed by many, in particular Shawn Sabbets, author of ratpoison (a Linux tool that arranges all your windows without gaps))

See 〈The Idiocy of Hacker Keyboards〉 http://xahlee.org/emacs/keyboards_hacker_idiocy.html

• «I'm a programer. I never use the F1 F2 etc keys, and find those Media keys or extra app launching keys stupid.» This is seen often on programer forums or keyboard review sites such as amazon.

for 70 articles on Keyboards, Layouts, Hotkeys, Macros, RSI, typing
habits, see:
http://xahlee.org/Periodic_dosage_dir/keyboarding.html

PS i think Stephen, Peter, Shawn are great coders, but just that some of their opinions on keyboard i find falling into common myth.

programer will be recalcitrant on their opinions about keyboard, because they'd say “i use it all my life!”. Yet, typically they never spend a hour to look into the actual field of keyboarding issues or field of study of ergonomics.

This situation is similar to for example pro mathematicians will admadantly claim some math notation issues, or love of TeX/LaTeX, like, “i should know because i work with it all my life”, yet their opinion being completely idiotic.

also similar, is lots of programers, who, over the years in their career, inevitably came to know several langs. So, they'll have bunch of extremely idiotic opinions on language design, syntax, and software engineering, terminologies, semantics. They'll be loud about it. Yet, they really don't know much of any of these fields as a dedicated study. e.g. they have never taken a day in their lifes, to actually study a article, or issue, about a syntax design as a subject by itself. Typically, what they've done instead, is like: «perl is like this, or lisp is like this, or i know Haskell this and OCaml that way, i've coded in them for 10 years, and i've taken a class about parsing in college, therefore, it should be X, i tell you!».

I LOL

Xah

2010-11-16

emacs define-mode-abbrev oddity?

http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/f32a510414508935#

On Nov 16, 6:54 am, harven wrote:
> Xah Lee writes:
> > this is a odd thing.
>
> > when in emacs-lisp-mode, and when you define a abbrev (e.g. call
> > define-mode-abbrev then “ah” then “add-hook”), then call write-abbrev-
> > file
>
> > then you get this in your abbrev file (e.g. at 〔~/.emacs.d/
> > abbrev_defs〕)
>
> > (define-abbrev-table 'lisp-mode-abbrev-table '(
> >     ("ah" "add-hook" nil 0)
> > ))
>
> > note that it's lisp-mode-abbrev-table not emacs-lisp-mode-abbrev-
> > table.
>
> > Why's that?
>
> > (if you change it to the latter, it won't work.)
>
> > i'm wondering because i want the abbrev to be for emacs-lisp-mode
> > only, not general lisp mode.
> > It appears that emacs-lisp-mode is defined on top of lisp-mode. Ok, so
> > my question is, what's the purpose of lisp-mode? Is that supposed to
> > be the base for other lisp lang modes to be defined on top of? A look
> > at scheme-mode seems to confirm this, but still, i want my abbrev for
> > emacs lisp mode only. Is that possible?
>
> > thanks.
>
> >  Xah ∑http://xahlee.org/☄
>
> I would try the following in .emacs
>
> (define-abbrev-table 'emacs-lisp-mode-abbrev-table '(
>   ("ah" "add-hook" nil 0)))
>
> (add-hook 'emacs-lisp-mode-hook (lambda()
>          (setq abbrev-mode t)
>          (setq local-abbrev-table emacs-lisp-mode-abbrev-table)))

thanks. Interesting solution.

Before i redefine my stuff, i did some more testing on my original question.

i tried to go to scheme-mode and apparantly the abbrev does not work, but only in emacs-lisp-mode.

if i'm in scheme-mode and i call define-mode-abbrev, it generate this code:

(define-abbrev-table 'scheme-mode-abbrev-table
'(
("ttt" "hhh" nil 0)
))

So, my question is probably caused by unnecessarily looking under the hood.

> I think that the nil argument after add-hook is deprecated in emacs ≥ 23.

any reference you have on this? thanks.

Xah ∑ http://xahlee.org/ ☄

emacs macro, use of keys

2010-11-16

http://xahlee.org/emacs/emacs_macro_example.html
http://groups.google.com/group/comp.emacs/browse_frm/thread/b144ac63476bbd2a#

On Nov 16, 8:20 pm, des...@verizon.net wrote:
> Xah Lee writes:
> > new article on emacs keyboard macro as well as elisp code.
> > Command Name       Key
> > start-kbd-macro     Ctrl+x (
> > end-kbd-macro       Ctrl+x )
> > call-last-kbd-macro         Ctrl+x e
> > apply-macro-to-region-lines        
> > Saving Your Keyboard Macro for Future Use
>
> Nice article.
>
> I use keyboard macros a lot and usually apply them to many lines.
>
> I could never see how the binding C-x e is sufficient.
> It's way too hard to type 5, 10, or 100 times.
>
> I know it can be repeated with a count but still sometimes I want
> to move around and apply it to various lines or words.
>
> So, I use this keybinding:
>
> (define-key global-map [(S-f19)] 'call-last-kbd-macro);; Shifted PgUp Key
>
> This converts the Page Up key in the 6 key group above the arrow keys
> into a repeat macro key.
>
> All my bindings for the PgUp key:
>
> (define-key global-map [(f19)] 'repeat-complex-command)
> (define-key global-map [(S-f19)] 'call-last-kbd-macro)
> (define-key minibuffer-local-map [(f19)] 'previous-history-element)
> (define-key minibuffer-local-map [(shift f19)] 'next-history-element)

nice and interesting.

i didn't know that PageUp key is also f19 in emacs?
A quick search in elisp manual doesn't seem to find it. Any pointer?

i have never used “repeat-complex-command” myself.

for me, the page up/down keys are used more for things related to moving by chunk.

Ctrl+PageUp = previous-user-buffer
Ctrl+PageDn = next-user-buffer

Hyper+PageUp = search-pagebreak-prev
Hyper+PageDn = search-pagebreak-next

(the search-pagebreak-prev is pretty much emacs's backward-page, but backward-page's got a problem in that it doesn't do so if the formfeed char ^L is part of a comment, sometimes required because the lang take ^L as syntax error)

other my combo with Page key are pretty standard:

Shift+PageUp = scroll-down with selection.
Alt+PageUp = scroll-other-window-down

same for Down...

for extra function keys, i use the keys on the number pad, either system-wide or within emacs.

e.g.

+ = switch to last app
- = next song
Shift+- = last song
1 = describe-char
4 = ispell-word
0 = lookup-word-definition
Ctrl+0 = lookup-wikipedia
. = xah-browse-url-at-point

many of these functions are personally defined ones or in ErgoEmacs.

for system-wide, it's either defined in AutoHotkey or IntelliType, and sometimes app dependent.
The f1 to f12 are all used up. They pretty much are one-key press to switch to a particular app. e.g. emacs is f6, Firefox is f7, Google Chrome is f4, IE is f9, PowerShell is f10...

Xah

2010-11-08

3d description language

2010-11-08

Xah wrote:
> i've been wondering about that. Specifically, for my needs, i really
> need a lang like povray that lets me program (say in python) to
> generate the povray sphere box lighting etc positions and sizes, to
> generate a picture. Usually for math illustration purposes.
>
> • 〈Illustrating Geometry with POV-Ray〉http://xahlee.org/3d/illus_geometry.html
>
> however, for my need i don't really need realism rendering alone with
> its waiting for the picture.
>
> also, i really want real-time viewing and animation than static
> images. (see  http://xahlee.org/3d/viz.html)
>
> so, in past few years, i've been somewhat looking. Am pretty sure
> these days Blender or perhaps others has scripting that that really
> does what i need much better that POV-Ray. That is, a language that
> describe geometry primitives that can be rendered, but i don't really
> need fancy rendering like ray-tracing, but more or less just
> projection and dynamic interaction....
>
> for example, let's say i have a sphere of radius 1 at position {2,3,4}
> and  a box of side length 1 ot {2.5,2, 2}. Then, suppose my camera
> (view point) is at {-1,3,2} looking in the direction of origin.

namekuseijin wrote:
> yes, but you can't "code" in those with the same ease as with pov's
> SDL.
>
> in povray SDL:
>
> sphere { 1 <2,3,4> }
> box { -1,1 translate <2.5,2,> }
> camera { location <-1,3,2> look_at 0 }
> // some light, will ya?
> ligh_source { <1,1,-1>*10 1 }
>
> in python using Blender API:
>
> cam = bpy.data.scenes[0].camera
> cam.location = (-1,2,3)
>
> that just adjusts the current scene camera location to your desired
> location.  I don't even know how to do the rest, like even locking its
> focus to the origin, let alone adding the primitives... if the log in
> 2.55 is of any use, the operation to add a sphere is:
>
> bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16, size=1,
> view_align=False, enter_editmode=False, location=(-1.35352, -2.99709,
> 0), rotation=(0, 0, 0), layer=(True, False, False, False, False,
> False, False, False, False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> sucks, huh?  Blender is a wonderful tool for artists, not much for
> programmers or math-types.

humm...

maybe it's time to ask stackoverflow for a definitive answer about this.

i find it hard to believe there's no lang that describe 3D primitives.

actually, there's Mathematica
• 〈Introduction To Mathematica's 3D Graphics Format〉
http://xahlee.org/3d/mma.html

and there's a LOT for 2D (svn, flash, there's a js lib i recently learned but forgot the name).

for 3D, there's google's
http://code.google.com/p/o3d/

which is very promising, but i haven't spent time on yet.

but i was really hoping in Blender too... given its status, i think it's trivial to create a primitive descriptive lang similar to POV-Ray, and my guess is that it's already there...

> > My question is, those who blender experience, whether blender could
> > practically be used like POV-Ray since i don't really need POV-Ray's
> > rendering but need all the blender's interactivity etc features.
>
> if you need interactivity, you don't need scripting with python
> either.  Just use the menus and options.  That's the way to use
> Blender, since its geared at artists.
>
> here's my best attempt ever at something artistic with Blender:
>
> http://blenderartists.org/forum/showthread.php/190197-Stereo-Fruits

the best i've done is a cube. lol.

btw, do you know how to in POV-Ray to make the rendering outline only? e.g. like those of technical drawing. i.e. similar to showing just wireframe, but taking out all the wires only showing the object edge, and also hide internal or other parts that's can't be seen.

Xah ∑ http://xahlee.org/ ☄



On Nov 9, 1:36 am, namekuseijin wrote:
> On Nov 8, 11:54 pm, Xah Lee wrote:
>
> > about Blender not able to take a scene description file for creating
> > simple geometric objects, i'm still not sure. There's also the .obj
> > file, and recently collada file format, and vrml, and possibly there's
> > import utility that takes pov files. So, it's likely one can just use
> > python to create objects in these files. Also, besides Blender,
> > there's quite a few other free 3D modelers... am sure one of them can
> > do it.
>
> > ... also, Second Life is about to support importing mesh using collada
> > format.
>
> > am sure that for someone working in this area... there's easy route to
> > create 3D scenes by using python or any lang to generate a file of
> > highlevel dsecription 3d primitives similar to pov's format, then just
>
> hmm, .obj and collada are file formats for raw meshes.  That means you
> would use python to generate meshes vertex by vertex.  In that case,
> even a stupid call like:
>
> bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16, size=1,
> view_align=False, enter_editmode=False, location=(-1.35352, -2.99709,
> 0), rotation=(0, 0, 0), layer=(True, False, False, False, False,
> False, False, False, False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> is higher level than that...
>
> I still very much prefer sphere { location radius }, though...
>
> you could certainly hid it away like:
>
> def sphere( loc=(0,0,0), radius = 1 ):
>     return bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16,
> size=radius*2,
> view_align=False, enter_editmode=False, location=loc, rotation=(0, 0,
> 0), layer=(True, False, False, False, False,False, False, False,
> False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> and for the other primitives as well...

yes. but the point is it is trivial to write a functions to generate primitives as vertexes.

so, you can write

def sphere(center, radius, meshdensity) = {...}

On Nov 9, 1:36 am, namekuseijin wrote:
> On Nov 8, 11:54 pm, Xah Lee wrote:
>
> > about Blender not able to take a scene description file for creating
> > simple geometric objects, i'm still not sure. There's also the .obj
> > file, and recently collada file format, and vrml, and possibly there's
> > import utility that takes pov files. So, it's likely one can just use
> > python to create objects in these files. Also, besides Blender,
> > there's quite a few other free 3D modelers... am sure one of them can
> > do it.
>
> > ... also, Second Life is about to support importing mesh using collada
> > format.
>
> > am sure that for someone working in this area... there's easy route to
> > create 3D scenes by using python or any lang to generate a file of
> > highlevel dsecription 3d primitives similar to pov's format, then just
>
> hmm, .obj and collada are file formats for raw meshes.  That means you
> would use python to generate meshes vertex by vertex.  In that case,
> even a stupid call like:
>
> bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16, size=1,
> view_align=False, enter_editmode=False, location=(-1.35352, -2.99709,
> 0), rotation=(0, 0, 0), layer=(True, False, False, False, False,
> False, False, False, False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> is higher level than that...
>
> I still very much prefer sphere { location radius }, though...
>
> you could certainly hid it away like:
>
> def sphere( loc=(0,0,0), radius = 1 ):
>     return bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16,
> size=radius*2,
> view_align=False, enter_editmode=False, location=loc, rotation=(0, 0,
> 0), layer=(True, False, False, False, False,False, False, False,
> False, False, False, False, False, False, False,
> False, False, False, False, False))
>
> and for the other primitives as well...

yes. but the point is it is trivial to write a function to generate primitives as vertexes.

so, you can write

def sphere(center, radius, meshdensity) = {...}

def rectangle(center, sideLength1, sideLength2,sideLength3, meshdesity) = {...}

def cone(vertex, height, orientation, angle) = {...}

def parametricSurface(formula, uRange, vRange, steps) = {...}

etc. trivially.

Then, you create your scene by calling these functions. Then, they print to a mesh format file. Then, call another app or using the 3D modeler's scripting lang to import this .obj or collada file into the 3D modeler, then you have it.

all this can be done easily... perhaps with AutoHotkey so one doesn't even need to use the mouse.

Xah


On Nov 9, 12:50 pm, namekuseijin wrote:
> On 9 nov, 18:06, Xah Lee wrote:
>
> > On Nov 8, 11:49 am, namekuseijin wrote:
>
> > > there are some very tricky tricks to do that, like this:
>
> > >http://tuabiht.chez-alice.fr/PovEdge_Site/PovEdge.html
>
> > wrote a article about this.
>
> > • 〈Outline Rendering of 3D Models (POV-Ray)〉http://xahlee.org/3d/outline_rendering.html
>
> "I think the fact POV-Ray cannot do it is just a particular historical
> or idiosyncratic reason."
>
> it's like I said before:  povray uses true math primitives as
> described by math equations.  There are no edges or faces to compute
> or hide:  just math surfaces that are either intersected or not by
> light rays (line segments).  All raytracers do it that way, but some
> specialize only in coarse and limited mesh-based geometry.  Povray
> supports meshes, though, which is why PovEdge works:  everything in
> PovEdge scenes is made out of meshes, even spheres or cubes, and thus
> the povedge macro can calculate edges and such needed info.

the fact POV-Ray use math equations as opposed to meshes to represent its 3d primitives doesn't matter. Again, it's just how POV-Ray came to be, it's particular idiosyncracy, its feature set, data structure and algorithm choices, implementation decisions. Doesnt matter what modeling tech a 3d app uses, may it be math equation or polygons or nurbs or other variations. The goal is to render the output image using uniform color for all visible surface. (aka outline rendering; cartoon style)

btw, Second Life can do it, and i think isn't the Zelda on Nintendo Cube done in a cartoon style? (thin it was around 2004?) so, clearly the technology to render 3d modeles as outline (flat cartoon illustrations) in real time is already a solved problem. Having just wrote that, i think any 3D field pro can simply tell us how to do it.

> > do u have a real name namejuseijin? makes people more comfortable
> > citing you.
>
> Namekuseijin At Gmail Dot Com
>
> :)
>
> shouldn't we be doing this by mail?  I'm sure Lispers are not
> amused...

they are certainly amused. All this can be done in lisp. And, isn't there some 3d modeler using lisp? there's autolisp... :) and the famous SICP book uses algorithmic art as one of its main subject in i think chapter 2.

the 3d modeler Wings is written in Erlang... oops wait, that's not lisp.

Xah

2010-11-07

is there povray lang without rendering?

On Nov 7, 5:48 am, namekuseijin wrote:
> On 6 nov, 13:50, Xah Lee wrote:
> > i think povray was geek love about 15 years ago. I think it's dead
> > since mid 2000s.
> > In the 1990s or perhaps 1980s, it used to be that every self-
> > respecting coder would know about POV-Ray. Today, i don't think most
> > “hackers” know what it is. But they probably have heard of Blender and
> > Gimp for sure.
>
> yes, but you can't "code" in those with the same ease as with pov's
> SDL.

i've been wondering about that. Specifically, for my needs, i really need a lang like povray that lets me program (say in python) to generate the povray sphere box lighting etc positions and sizes, to generate a picture. Usually for math illustration purposes.

• 〈Illustrating Geometry with POV-Ray〉
http://xahlee.org/3d/illus_geometry.html

however, for my need i don't really need realism rendering alone with its waiting for the picture.

also, i really want real-time viewing and animation than static images. (see http://xahlee.org/3d/viz.html )

so, in past few years, i've been somewhat looking. Am pretty sure these days Blender or perhaps others has scripting that that really does what i need much better that POV-Ray. That is, a language that describe geometry primitives that can be rendered, but i don't really need fancy rendering like ray-tracing, but more or less just projection and dynamic interaction....

for example, let's say i have a sphere of radius 1 at position {2,3,4} and a box of side length 1 ot {2.5,2, 2}. Then, suppose my camera (view point) is at {-1,3,2} looking in the direction of origin.

all i want, is to have this rendered into a image. But i don't need realistic rendering. I rather have instantaneous rendering even with just outline, and say once it's created in blender, i can rotate or change view point in real time.

is this possible with blender?

for example, here's POV-Ray rendering:

http://xahlee.org/SpecialPlaneCurves_dir/ConicSections_dir/ball_shadow.png

showing some properties of conics. Really nice. But often all i need are these:

http://xahlee.org/3d/i2/conicsHypCut3D.png
http://xahlee.org/surface/helicoid-catenoid/helicoid-catenoid_twist4.png
http://xahlee.org/MathGraphicsGallery_dir/sphere_projection/sphere_proj_illus.png
http://xahlee.org/PageTwo_dir/MathPrograms_dir/scr/curved_space_mac.jpg
http://xahlee.org/MathGraphicsGallery_dir/SpheresCubes_dir/spheresCubes.html

i tried to learn blender but it's quite complex.

btw, i HAVE spent many hours reading about Blender. I know it has scripting lang (it uses python) and i know it even have a game engine built in (meaning: real-time animation and physics engine even, particle systems etc. But i think the project is still much beta and no doc).

My question is, those who blender experience, whether blender could practically be used like POV-Ray since i don't really need POV-Ray's rendering but need all the blender's interactivity etc features.

Xah

 It's the difference between having a DSL and having a general-
> purpose language with lib calls.  Makes quite a difference, specially
> for stuff like this:
>
> http://local.wasp.uwa.edu.au/~pbourke/exhibition/scc4/final/
>
> its newsgroups still is very much alive though, specially off-topic.

is there povray lang without rendering?

On Nov 7, 5:48 am, namekuseijin wrote:
> On 6 nov, 13:50, Xah Lee wrote:
> > i think povray was geek love about 15 years ago. I think it's dead
> > since mid 2000s.
> > In the 1990s or perhaps 1980s, it used to be that every self-
> > respecting coder would know about POV-Ray. Today, i don't think most
> > “hackers” know what it is. But they probably have heard of Blender and
> > Gimp for sure.
>
> yes, but you can't "code" in those with the same ease as with pov's
> SDL.

i've been wondering about that. Specifically, for my needs, i really need a lang like povray that lets me program (say in python) to generate the povray sphere box lighting etc positions and sizes, to generate a picture. Usually for math illustration purposes.

• 〈Illustrating Geometry with POV-Ray〉
http://xahlee.org/3d/illus_geometry.html

however, for my need i don't really need realism rendering alone with its waiting for the picture.

also, i really want real-time viewing and animation than static images. (see http://xahlee.org/3d/viz.html )

so, in past few years, i've been somewhat looking. Am pretty sure these days Blender or perhaps others has scripting that that really does what i need much better that POV-Ray. That is, a language that describe geometry primitives that can be rendered, but i don't really need fancy rendering like ray-tracing, but more or less just projection and dynamic interaction....

for example, let's say i have a sphere of radius 1 at position {2,3,4} and a box of side length 1 ot {2.5,2, 2}. Then, suppose my camera (view point) is at {-1,3,2} looking in the direction of origin.

all i want, is to have this rendered into a image. But i don't need realistic rendering. I rather have instantaneous rendering even with just outline, and say once it's created in blender, i can rotate or change view point in real time.

is this possible with blender?

for example, here's POV-Ray rendering:

http://xahlee.org/SpecialPlaneCurves_dir/ConicSections_dir/ball_shadow.png

showing some properties of conics. Really nice. But often all i need are these:

http://xahlee.org/3d/i2/conicsHypCut3D.png
http://xahlee.org/surface/helicoid-catenoid/helicoid-catenoid_twist4.png
http://xahlee.org/MathGraphicsGallery_dir/sphere_projection/sphere_proj_illus.png
http://xahlee.org/PageTwo_dir/MathPrograms_dir/scr/curved_space_mac.jpg
http://xahlee.org/MathGraphicsGallery_dir/SpheresCubes_dir/spheresCubes.html

i tried to learn blender but it's quite complex.

btw, i HAVE spent many hours reading about Blender. I know it has scripting lang (it uses python) and i know it even have a game engine built in (meaning: real-time animation and physics engine even, particle systems etc. But i think the project is still much beta and no doc).

My question is, those who blender experience, whether blender could practically be used like POV-Ray since i don't really need POV-Ray's rendering but need all the blender's interactivity etc features.

Xah

 It's the difference between having a DSL and having a general-
> purpose language with lib calls.  Makes quite a difference, specially
> for stuff like this:
>
> http://local.wasp.uwa.edu.au/~pbourke/exhibition/scc4/final/
>
> its newsgroups still is very much alive though, specially off-topic.


On Nov 8, 11:49 am, namekuseijin wrote:
> On 8 nov, 17:02, Xah Lee wrote:
>
> > Xah wrote:
> > > bpy.ops.mesh.primitive_uv_sphere_add(segments=32, rings=16, size=1,
> > > view_align=False, enter_editmode=False, location=(-1.35352, -2.99709,
> > > 0), rotation=(0, 0, 0), layer=(True, False, False, False, False,
> > > False, False, False, False, False, False, False, False, False, False,
> > > False, False, False, False, False))
>
> > but i was really hoping in Blender too... given its status, i think
> > it's trivial to create a primitive descriptive lang similar to POV-
> > Ray, and my guess is that it's already there...
>
> Its language is python and all it does is access Blender API.  In
> other words:  it's merely a general-purpose language calling libs and
> it does suck for that task.  Pov's SDL OTOH is a DSL for 3D scenes and
> a very good one at that.  It's particularly best for math
> visualization indeed.  It's isosurface primitive can describe general
> functions.
>
> > the best i've done is a cube. lol.
>
> but that's the default scene! :p
>
> > btw, do you know how to in POV-Ray to make the rendering outline only?
>
> there are some very tricky tricks to do that, like this:
>
> http://tuabiht.chez-alice.fr/PovEdge_Site/faq.html
>
> but it's not very feasible because that's not how povray works:  there
> are no "edges" so to speak in povray primitives because they're not
> polygon meshes, they are indeed geometrical primitives described by
> math equations.  Raytracers simply intersect light rays in the scene
> with the surface of such geometric objects.
>
> still, you may try it.

http://tuabiht.chez-alice.fr/PovEdge_Site/PovEdge.html

that's useful info! exactly what i needed. Too bad POV-Ray can't do it.

about Blender not able to take a scene description file for creating simple geometric objects, i'm still not sure. There's also the .obj file, and recently collada file format, and vrml, and possibly there's import utility that takes pov files. So, it's likely one can just use python to create objects in these files. Also, besides Blender, there's quite a few other free 3D modelers... am sure one of them can do it.

... also, Second Life is about to support importing mesh using collada format.

am sure that for someone working in this area... there's easy route to create 3D scenes by using python or any lang to generate a file of highlevel dsecription 3d primitives similar to pov's format, then just run a program so that the file gets important into any of the interactive 3d package, thus then can be viewed and manipulated in real time.

Xah

2010-11-04

emacs CEDET

On Nov 4, 1:25 am, Elena wrote:
> On Oct 30, 2:19 pm, Xah Lee wrote:
>
> > If i
> > write a emacs book, are you likely to buy it?
>
> >     * Yes, if it's good.
>
> >     * No, am not likely to spend money on emacs/elisp book.
>
> I voted "no" because I don't think an Emacs Cookbook is needed: there
> is enough information scattered around the Internet already.  What I
> feel the lack of is a structured in-depth explanation of Emacs' most
> complex packages: CEDET, Semantic Bovinator, ecc.  which are not
> explained in Emacs' manual.
>
> A guide to setup Emacs to its best: that's something I would pay for.

yeah. CEDET is a beast. But it's also for very advanced elisp coders. Cookbooks or most programing books (e.g. O'Reilly) don't cover the really advanced things, because there's little market for it.

CEDET's future status isn't mature though. I think few people, even senior emacs developers, actually use or know how to make use of it. I think there are probably less than a hundred people in the world knows CEDET enough to write elisp package using it.

if writing a cookbook focused on emacs lisp programing, then probably a chapter introducing CEDET is proper. It also means i'll probably spend at least a month full time just to study CEDET. :)

O, and Elna, you are a emacs dev for many years right? haha. You probably can write a chapter on cedet much easier and better than i can.

Xah ∑ http://xahlee.org/ ☄

2010-11-01

why use special unicode chars

From: Xah Lee
Date: Oct 18, 3:29 am
Subject: What's List Comprehension and Why is it Harmful?
To: comp.lang.lisp, comp.lang.scheme, comp.lang.functional

On Oct 18, 3:03 am, Marc Mientki wrote:

> Am 18.10.2010 11:59, schriebXahLee:

> > On Oct 18, 2:34 am, Marc Mientki  wrote:
> >> One question: why contain your pages always this junk? (red marked):
> >>    http://img256.imageshack.us/img256/7618/xahleehtmljunk.jpg

> >> regards
> >> Marc

> > ug. what browser + OS are you using?

> Firefox 3.6.10 on windows XP + SP3.

> > those are unicode 「」
> > LEFT CORNER BRACKET x300c
> > RIGHT CORNER BRACKET x300d

> Is there need for unicode for such trivial things like {[]}?

short story is no but am a unicode geek :)

long story is... i need a way to quote code...  the corner bracket was
choosen because it's standard chinese punctuation thus almost all
computer today bought in the past 5 years can display it, and because
it's different than ascii so it avoids ambiguity and complications.
e.g. when the quoted text also contains the char that you use for
quoting....

thanks for your info. I'll think about removing them...

the other thing is that those markers are very useful when you think
about info processing and automation. e.g. in the future i can
trivially write a script list all inline code i have on my site, or to
htmlize/css all quoted code. e.g.

• 〈Unix Shell Text Processing Tutorial (grep, cat, awk, sort, uniq)〉
http://xahlee.org/UnixResource_dir/unix_shell_text_processing.html

in that page, does the char show up correctly? The chars are not in
the html text, but is added by CSS due to markup. And the code are all
colored red.

PS: the most popular example of studious use of quoting in a tech doc
is emacs manual or any manual from FSF. e.g.

• 〈Constant-Variables〉
http://xahlee.org/elisp/Constant-Variables.html

but however, they use ascii hack of the 1970s, e.g. like `this' and
``this''.

Xah ∑ http://xahlee.org/ ☄

2010-10-28

land of lisp

On Oct 28, 12:59 am, Lawrence D'Oliveiro wrote:
> In message
> <3fe80ac4-b595-4bcb-96b9-9138b1ec5...@l17g2000yqe.googlegroups.com>,
>
> TheFlyingDutchman wrote:
> > On Oct 27, 4:55 pm, Lawrence D'Oliveiro
> > wrote:
>
> >> Would it be right to say that the only Lisp still in common use is the
> >> Elisp built into Emacs?
>
> > There is a new version of Lisp called Clojure that runs on the Java
> > Virtual Machine (JVM) that is on the upswing.
>
> Now is not exactly a good time to build new systems crucially dependent on
> the continuing good health of Java though, is it?

java's been receiving shit in recent years... Sun went belly up, Apple bans it, Oracle sues... but one thing to note that it is currently the most popular lang, or top 3, among C, C++. And java is certainly better than these 2. Sad to know, but java, along with its jvm, is likely to be with us for a while.

btw, interesting to know that the landoflisp site mentioned Common Lisp, Scheme lisp, clojure, arc lisp, and emacs lisp in the vid too, but didn't newLisp or Qi lisp.

here's my fav part of the comics
http://xahlee.org/comp/land_of_lisp.html

Conrad is certainly a fervent lisp lover. ( as is Peter Seibel http://www.gigamonkeys.com/book/ ) Conrad is also a comics artist. The landoflisp is going all over on twitter yesterday and apparantly many already ordered it. Hope he does very well.

Xah


http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/336dd4a8ee9881fc#

2010-10-26

apple and google are monopoly

On Oct 25, 9:23 am, Raffael Cavallaro wrote:
> On 2010-10-25 11:51:28 -0400, Tamas K Papp said:
>
> > what the regulators
> > look at is not whether you have market power, but whether you are
> > abusing it, and you don't need to be a monopoly for that.  So if Apple
> > gets nasty, the mere existence of other alternatives may not be enough
> > for them to get away with it.
>
> There is some speculation that this has already happened; Adobe filed a
> complaint with both the US DOJ and the European Competition Commission,
> and once these bodies began investigations, Apple relented and allowed
> non-apple developer tools and languages for the iOS. We don't know if
> this was direct cause and effect, but it is quite possible that the
> ongoing investigations into abuses of market power caused Apple to
> change its behavior.

this quip been going around later: «Welcome to 2010: Java is a restricted platform; Google is evil; Apple is a monopoly; and Microsoft is the underdog.» (who first said it?)

to recap:

in the 1970s: Unix is the monopoly.

in the 1980s: IBM is the monopoly.

in the 1990s: Microsoft is the monopoly.

in the 2000s: Google is the monopoly.

in the 2010s: Apple is the monopoly.

i lol.

• 〈The Microsoft Hatred FAQ〉
http://xahlee.org/UnixResource_dir/writ/mshatredfaq.html

Xah

2010-10-23

what's a good js/dom reference?

what's a good js/dom reference?

i know ms one
http://msdn.microsoft.com/en-us/library/ms533050(VS.85).aspx
but that's jscript specific.

the gecko one
https://developer.mozilla.org/en/Gecko_DOM_Reference
seems to me a wiki limbo.

the other is w3school
http://www.w3schools.com/jsref/dom_obj_style.asp

are there better ones?

http://stackoverflow.com/questions/4003891/whats-a-good-js-dom-reference

2010-10-22

Apple is deprecating Java!

http://groups.google.com/group/comp.lang.java.programmer/browse_frm/thread/e529dd3d8ed2d70a
http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/e5ec2f99fbcaede1#

On Oct 21, 2:17 pm, Arne Vajhøj wrote:
> > possibly is goes to being more like Windows:
> > people use the Sun/Oracle implementation, rather than a native version
> > provided by the OS vendor.
>
> Could be.
>
> If Oracle wants to.
>
> Technically it would not be a big problem given that OpenJDK
> BSD port builds on MacOS X!
>
> But that does not guarantee that the business case will be
> good.
>
> > MS essentially killed off their own Java implementation as well, and no one
> > noticed.
>
> A lot of people noticed when applets stopped working
> on a newly installed Windows.
>
> And it was not voluntarily.
>
> So not that good an analogy.

and remember when java started, Sun pitches it to be the revolution of
the web, where, every webpage will be dynamic with java applet. So in
late 1990s, huge amount of toy applets showed up, but since dot com bubble,
these just waned, Flash and js took over. Sun did a bunch of idiotic
things like started to have some java web start, a bunch of scripting
langs in java like groovy n beenshell stuff , javaFX (another jargon
shit), but tooo little tooo late. n what's that java markup lang? ah
JSP. I used it in 2000. incredibly idiotic.

Java pretty much moved very early to server market. Originally it is intended to be a lang for embedded devices... is it much used there?

actually am too out of touch here. The only thing i know is that Google use it heavily for their entire web apps. Who uses java besides Google? and for what? I can just remember Steve Jobs saying “Nobody uses Java anymore”. and That was in 2007.

Xah ∑ http://xahlee.org/ ☄

2010-10-20

my comp lang experiences

On Oct 20, 5:30 am, Marc Mientki wrote:
> Am 20.10.2010 14:07, schrieb Xah Lee:
>
> > On Oct 20, 4:52 am, Marc Mientki  wrote:
> >> Am 20.10.2010 13:14, schrieb Xah Lee:
>
> >>> See also:
>
> >>> • 〈The Importance of Terminology's Quality In Computer Languages〉
> >>> http://xahlee.org/UnixResource_dir/writ/naming_functions.html
>
> >>> where i gave some examples of the naming.
>
> >>     "I'd like to introduce a blog post by Stephen Wolfram, on the design
> >> process of Mathematica. In particular, he touches on the importance of
> >> naming of functions."
>
> >>     "The functions in Mathematica, are usually very well-named, in
> >> contrast to most other computing languages."
>
> >>     "Let me give a few example. [...]"
>
> > thanks for your post. didn' t know you also use Mathematica.
>
> Not anymore, unfortunately. New job = no Mathematica. I tried with
> Maxima, but it is considered syntactically Middle Ages. Terribly
> confused (vectors, arrays, matrix, lists, sets - maxima does not know
> the motto of "list for everything").
>
> >> It is much easier to improve something good than to invent from scratch.
> >> When Lisp was born, Stephen Wolfram was still wearing diapers.
>
> >> For your information: Mathematica was my first Lisp-like language. I
> >> used it about 10 years almost every day and I love it because of the
> >> beauty of the concept. But Mathematica has two serious problems: first,
> >> there is only one implementation and it is commercial, and secondly,
> >> Mathematica is very, very slowly and does not generate executable code
> >> that can be used without Mathematica itself. Thus, comparisons to other
> >> languages, such as Lisp are not fair.
>
> > you are right... thought these aspects don't have much to do with
> > function naming.
>
> Yes. I have it written because I see that you like to call Mathematica
> as a counter-example, in many cases.
>
> > i tend to think that Mathematica is that way due to a unique mind,
> > Stephen Wolfram. And if i may say, i share much mindset with him with
> > respect to many lang design issues.
>
> Yes, me too, alone but for performance reasons, Mathematica in the area
> where I work (image processing) is not suitable. I mean - not research
> or rapid prototyping, but industrial image processing.
>
> > (or rather, Mathematica was my
> > first lang for about 6 years too)
>
> Mathematica = first language at all? No FORTRAN/BASIC/Pascal/C?

yeah. actually the first lang is HP-28s calculator.

• 〈HP-28S Advanced Scientific Calculator〉
http://xahlee.org/prog/hp28s/hp28s.html

• 〈Xah Lee's Computing Experience Bio〉
http://xahlee.org/PageTwo_dir/Personal_dir/xah_comp_exp.html



in short summary, counting only real serious involvement, say, few hours a day:

• 1991 to 1994, HP-28s.
• ~1992 to 1998. Mathematica
• 1996 to now. html (and later years related css, xml )
• 1998 to 2004. Perl, sql, apache, bash, whole unix admin shebang.
• 2001, 2005. Java.
• 2005 to 2006 Python.
• 2005 to 2007 PHP (css and some javascript).
• 2006 to now. emacs lisp.

what's your experiences?

Xah ∑ http://xahlee.org/ ☄

mathematica function naming

On Oct 20, 4:52 am, Marc Mientki wrote:
> Am 20.10.2010 13:14, schrieb Xah Lee:
>
> > See also:
>
> > • 〈The Importance of Terminology's Quality In Computer Languages〉
> > http://xahlee.org/UnixResource_dir/writ/naming_functions.html
>
> > where i gave some examples of the naming.
>
>    "I'd like to introduce a blog post by Stephen Wolfram, on the design
> process of Mathematica. In particular, he touches on the importance of
> naming of functions."
>
>    "The functions in Mathematica, are usually very well-named, in
> contrast to most other computing languages."
>
>    "Let me give a few example. [...]"

thanks for your post. didn' t know you also use Mathematica.

on the aspect of function naming, i think Mathematica is rather unique in its philosophy. Am not aware any other lang old or new follows a similar philosophy... possibly except javascript.

> It is much easier to improve something good than to invent from scratch.
> When Lisp was born, Stephen Wolfram was still wearing diapers.
>
> For your information: Mathematica was my first Lisp-like language. I
> used it about 10 years almost every day and I love it because of the
> beauty of the concept. But Mathematica has two serious problems: first,
> there is only one implementation and it is commercial, and secondly,
> Mathematica is very, very slowly and does not generate executable code
> that can be used without Mathematica itself. Thus, comparisons to other
> languages, such as Lisp are not fair.

you are right... thought these aspects don't have much to do with function naming.

i tend to think that Mathematica is that way due to a unique mind, Stephen Wolfram. And if i may say, i share much mindset with him with respect to many lang design issues. (or rather, Mathematica was my first lang for about 6 years too) But i think rather, Mathematica's lang design philosophy more has to do with certain pure mathematician mindset. This is somewhat similar to how haskell is a lang designed such that it is much independent of any concept of hardware. Same here with Mathematica, but on the naming aspect, Mathematica's function names is designed without even much relation to comp sci lingoes, but rather, the essense of ideas captured in a mathematical way.

Xah ∑ http://xahlee.org/ ☄

2010-10-19

the use of honorific second person pronoun in chinese (nin 您)

the use of honorific second person pronoun in chinese (nin 您)

http://languagelog.ldc.upenn.edu/nll/?p=2719

when i went back to taiwan in 2004, while in the airplane, the chinese guy on the seat besides me (a very well educated young man, prob aged around 20, and seems to be in taiwan airforce to be a jet fighter pilot or something, affluent), addressed me as nin. And it is the first time i got addressed that in my life (but i haven't been in taiwan since i left in 1982 or so at age 14) I was rather pissed. I'm now old! (was only 36 at the time)

also, in my 14 years in taiwan, nobody calls taiwan “baodao”, except we are taught the propaganda that foreigners (the dutchs) appreciate and find taiwan so beeeutiful that they give it the name baodao. Also, it is used in travel brochures for foreigners. We just called it taiwan. (and at the time, while KMT was ruling, we are taught that when in international mail, we should use R.O.C. (Republic of China) instead (because for like 50 years, the big China continent is supposed to not exist, according to USAers and KMT and even UN). (but now the taiwan politics changed and the issue is more fucked up; nobody knows what we “should” call taiwan anymore))

Victor wrote: «During the classless decades after the founding of the PRC, nin2 was discouraged, perhaps even outlawed»

lol. the “perhaps even outlawed” should perhaps be dropped. What a propaganda.

i agree that i don't like nin, or any sort of honorific title. But y'know? it's part of the asian culture. you bow down to elders and ancestors. I think it's worse in Japan and their language. One negative perspective of this outcome is one bag of superficial shit and fakeness.

2010-10-18

unicode, quotation issues

On Oct 18, 3:03 am, Marc Mientki wrote:
> Am 18.10.2010 11:59, schrieb Xah Lee:
>
> > On Oct 18, 2:34 am, Marc Mientki  wrote:
> >> One question: why contain your pages always this junk? (red marked):
> >>    http://img256.imageshack.us/img256/7618/xahleehtmljunk.jpg
>
> >> regards
> >> Marc
>
> > ug. what browser + OS are you using?
>
> Firefox 3.6.10 on windows XP + SP3.
>
> > those are unicode 「」
> > LEFT CORNER BRACKET x300c
> > RIGHT CORNER BRACKET x300d
>
> Is there need for unicode for such trivial things like {[]}?

short story is no but am a unicode geek :)

long story is... i need a way to quote code... the corner bracket was choosen because it's standard chinese punctuation thus almost all computer today bought in the past 5 years can display it, and because it's different than ascii so it avoids ambiguity and complications. e.g. when the quoted text also contains the char that you use for quoting....

thanks for your info. I'll think about removing them...

the other thing is that those markers are very useful when you think about info processing and automation. e.g. in the future i can trivially write a script list all inline code i have on my site, or to htmlize/css all quoted code. e.g.

• 〈Unix Shell Text Processing Tutorial (grep, cat, awk, sort, uniq)〉
http://xahlee.org/UnixResource_dir/unix_shell_text_processing.html

in that page, does the char show up correctly? The chars are not in the html text, but is added by CSS due to markup. And the code are all colored red.

PS: the most popular example of studious use of quoting in a tech doc is emacs manual or any manual from FSF. e.g.

• 〈Constant-Variables〉
http://xahlee.org/elisp/Constant-Variables.html

but however, they use ascii hack of the 1970s, e.g. like `this' and ``this''.

Xah ∑ http://xahlee.org/ ☄

emacs irc client

Kenneth Tilton writes:
> Plus a question: best IRC Client for Ubuntu?

Pascal J. Bourguignon wrote:
> Of course, it all depends on the definition of 'best', but for a
> lisp programmer, which on a newsgroup like cll, it is the assumed
> context, only an emacs irc client can be the best, since it allows you
> to interact on irc with the lowest overhead and context switch cost.

actually, emacs rcirc consumes more resource than a dedicate GUI
one the Colloquy. This was my experienc from about 2005 to 2008 on mac os x
10.4. But also, emacs rcirc just flatly lost out on so many features when compared to Colloquy.

i haven't used irc for like 3 years, but here's what i recall:

• emacs one doesn't auto connect when there's network disruption (very common with wireless)

• emacs rcirc does not notify you if someone mentions your name. (you have to install some external mac growler extra, but even still, it sucks.)

some of these can be fixed but that usually means you spend few hours to dig lisp code and result is usually not satisfactory. There's also erc...

... quite few others. The only thing i like is that it's integrated. That i can easily swicch to any buffer and do copy/paste or call any lisp function such as insert date, link, or use my existing abbrevs and unicode insertion etc.

Xah ∑ http://xahlee.org/ ☄

2010-10-14

list comprehension considered harmful

2010-09-28

On Sep 28, 12:07 pm, namekuseijin wrote:
> On 28 set, 14:56, Xah Lee wrote:
>
> > ultimately, all lang gets transformed at the compiler level to become
> > machine instructions, which is imperative programing in the ultimate
> > sense.
>
> > You say that “do” is merely macro and ultimately function application.
> > But to what level should we go down this chain on how the language
> > actually works when evaluating a function in source code?
>
> > any functional lang, quickly becomes imperative when compiled to some
> > intermediate code or interpreted. In a sense, it can't be any other
> > way. Functions are abstract mathematical ideas, while “do” loop or any
> > instruction are actual steps of algorithms.
>
> That is true as of Mathematica too.  Difference being that do in
> scheme is pretty-much user-level syntax.  If you look in most (good)
> implementations sources, do and let are defined in scheme itself, not
> C or lower-level:  C code only deals with transforming lambda
> application and tail calls into proper gotos.
>
> So, as far as we're talking about scheme, haskell or Mathematica code,
> it's all functional in its abstraction context.
>
> do syntax does allow for imperative commands to be issued in scheme,
> just like let.  It does not mean it was used in said examples nor that
> do is automatically inherently imperative just because of choice of
> name.  imperative do -> (do (steppers ...) (final-condition? result)
> malign-imperative-code-here ...)
>
> so, now that we got it clear why do in scheme is not (inherently)
> imperative why were you bashing useful (at times) functional syntax in
> the form of list comprehensions again?

le's get precise. The argument i want to make, is this:

• “list comprehension” is a very bad jargon; thus harmful to functional programing or programing in general. Being a bad jargon, it encourage mis-communication, mis-understanding.

• “list comprehension” is a redundant concept in programing. The concept is of historical interest. e.g. when people talk about the history of computer languages. The LC can simply be filter(map(func, list), predicate).

• The special syntax of “list comprehension” as it exists in many langs, are not necessary. It can simply be a plain function, e.g LC(function, list, filter).

I gave a stand-alone explanation of these points at:
http://groups.google.com/group/comp.lang.lisp/msg/329b3b68ff034453

Do you disagree or agree with the above?

This is the point _I_ want to argue about, but you don't seem to admit any part of it, but you seems to want to discuss about “do” in Scheme lisp being functional.

So, perhaps we can now focus on this subject:

The “do” in Scheme lisp is not imperative, or, it can be considered as functional.

Alright. To be honest, i haven't had enough experience to comment on, but in general, i understand the example you've given, and i disagree.

Full report on your argument on this is given at:
http://groups.google.com/group/comp.lang.lisp/msg/87a987070e80231f

Now, in your message (quoted above), you made further argument on this. I think the main point is this, quote:

«do syntax does allow for imperative commands to be issued in scheme,
just like let. It does not mean it was used in said examples nor that
do is automatically inherently imperative just because of choice of
name. imperative do -> (do (steppers ...) (final-condition? result)
malign-imperative-code-here ...)»

i don't think your argument is forceful enough.

It appears that by this argument you even say that “let” is not functional.

Here, the issue verges on what is functional? What is a function? If a function in lisp is defined as macro, does it ceases to be considered as a function? Likewise, if a lisp's has “for” loop that is defined as a macro, is that “for” now considered a function?

this is getting quite iffy. What level or aspect are we considering? In each lang, usually they define certain terms specifically to the lang, and to various degree of precision. For eample, the term “object” means very different things in a technical way in different langs. Same for the word “function”, “keyword”, “command”, “module”, “package” ...

So, overall, i consider your argument for “do” in Scheme lisp being functional is weak, or trivial. It seems to be a pet peeve. You got annoyed because i seem to have ignored it entirely. But i got annoyed by you because you don't get the point about what i consider more significant opinion on “list comprehension”, which you totally ignored and kept at hacking the “do” in Scheme lisp.

Xah ∑ xahlee.org ☄

list comprehension the jargon

On Sep 29, 11:02 am, namekuseijin wrote:
> On 28 set, 19:38, Xah Lee wrote:
>
> > • “list comprehension” is a very bad jargon; thus harmful to
> > functional programing or programing in general. Being a bad jargon, it
> > encourage mis-communication, mis-understanding.
>
> I disagree:  it is a quite intuitive term to describe what the
> expression does.

what's your basis in saying that “list comprehension” is intuitive?

any statics, survery, research, references you have to cite?

to put this in context, are you saying that lambda, is also intuitive? “let” is intuitive? “for” is intuitive? “when” is intuitive? I mean, give your evaluation of some common computer language termilogies, and tell us which you think are good and which are bad, so we have some context to judge your claim.

For example, let us know, in your view, how good are terms: currying, lisp1 lisp2, tail recursion, closure, subroutine, command, object. Or, perhaps expound on the comparative merits and meaning on the terms module vs package vs add-on vs library. I would like to see your view on this with at least few paragraphs of analysis on each. If you, say, write a essay that's at least 1k words on this topic, then we all can make some judgement of your familiarity and understanding in this area.

Also, “being intuitive” is not the only aspect to consider whether a term is good or bad. For example, emacs's uses the term “frame”. It's quite intuitive, because frame is a common english word, everyone understands. You know, door frame, window frame, picture frame, are all analogous to emacs's “frame” on a computer. However, by some turn of history, in computer software we call such as “window” now, and by happance the term “window” also has a technical meaning in emacs, what we call “split window” or “pane” today. So, in emacs, the term “frame” and “window” is confusing, because emacs's “frame” is what we call “window”, while emacs's “window” is what me might call a pane of a split window. So here, is a example, that even when a term is intuitive, it can still be bad.

as another example, common understanding by the target group the term is to be used is also a important aspect. For example, the term “lambda”, which is a name of greek char, does not convey well what we use it for. The word's meaning by itself has no connection to the concept of function. The char happens to be used by a logician as a shorthand notation in his study of what's called “lambda calculus” (the “calculus” part is basically 1700's terminology for a systematic science, especially related to mechanical reasoning). However, the term “lambda” used in this way in computer science and programing has been long and wide, around 50 years in recent history (and more back if we trace origins). So, because of established use, here it may decrease the level of what we might think of it as a bad jargon, by the fact that it already become a standard usage or understanding. Even still, note that just because a term has establish use, if the term itself is very bad in many other aspects, it may still warrant a need for change. For one example of a reason, the argon will be a learning curve problem for all new generations.

You see, when you judge a terminology, you have to consider many aspects. It is quite involved. When judging a jargon, some question you might ask are:

• does the jargon convey its meaning by the word itself? (i.e. whether the jargon as a word is effective in communication)

• how long has been the jargon in use?

• do people in the community understand the jargon? (e.g. what percentage)

each of these sample questions can get quite involved. For example, it calls for expertise in linguistics (many sub-fields are relevant: pragmatics, history of language, etymology), practical experience in the field (programing or computer science), educational expertise (e.g. educators, professors, programing book authors/teachers), scientific survey, social science of communication...

also, you may not know, there are bodies of professional scientists who work on terminologies for publication. It is not something like “O think it's good, becus it is intuitive to me.”.

I wrote about 14 essays on various jargons in past decade. You can find them on my site.

i removed your arguments on other parts about “list comprehension”, because i didn't find them valuable. (barely read them) However, i appreciate your inputs on the “do” in Scheme lisp has a functional usage, and some other misc chat info from the beginning of this thread on comp.lang.lisp.

Xah ∑ xahlee.org ☄

list comprehension

2010-09-25

On Sep 24, 12:44 pm, namekuseijin wrote:
> On 22 set, 18:57, Xah Lee wrote:
>
> > gossip, Guy Steel, Lojban, Racket
>
> We know the man is made of steel, but it's actually "Steele"... :)
>
> > ----------
> > A classic piece of mockery of Guido by Schemers
>
> > • 〈The Fate of Lambda in Python 3000 and Scheme v300〉http://xahlee.org/comp/the_fate_of_lambda.html
>
> This is really old news, but in the case of Krishnamurthi's april
> fool's reply in the form of mockery of the alleged mockery by Guido:
>
> "We think dropping FILTER and MAP is pretty uncontroversial; (filter P
> S) is almost always written clearer as a DO loop (plus the LAMBDA is
> slower than the loop). Even more so for (map F S). In all cases,
> writing the equivalent imperative program is clearly beneficial."
>
> it just doesn't follow even as mockery, because of 3 things:
> 1) it assumes list comprehensions in python are imperative programming
> 2) it assumes do loops in scheme are imperative programming
> 3) it assumes do in scheme is the equivalent of list comprehensions in
> python

remember, a mockery does not mean it has to mirror every sentence with some consistent logic.

of course your are trolling, but your list above is questionable to me.

> 1) it assumes list comprehensions in python are imperative programming

i'd go as far to say that “list comprehension” in every lang is imperative programing.

for some explanation of “list comprehension” and several examples in different langs, see:
http://en.wikipedia.org/wiki/List_comprehension

the python example is given as:

S = [2*x for x in range(101) if x**2 > 3]

(see also:
• 〈Perl-Python Tutorial: List Comprehension〉
http://xahlee.org/perl-python/list_comprehension.html
)

you see, one characteristic of functional programing lang is that the lang has lots of single-purpose functions, and the user is supposed to sequence or combine them for max power and flexibility.

lisp comprehension is a fucking anomaly in this regards.
i dunno which fucking idiot invented it. (those expert with its history, please post)

from looking at the Wikipedia examples, you can see that typically it invents a new syntax. A better way and more in sync with functional lang spirit, is simply have this instead:

operation(
filterFunction(
listGenFunction(1, 20),
trueFalseDecisionFunction()
)
)

or in Mathematica:

Select[Range@20, # > 3 &]^2

in Mathematica FullForm notation, the above is:

Times[
Select[
Range[20],
Function[
Greater[ Slot[1],3] ]
],
2]

(formatted in a way so lispers can understand)

in my style of coding, the above is typically written like this:

(#*2 &) @ (Select[#,# > 3 &]&) @ Range@20


See also: • 〈A Example of Mathematica Notation and List Processing〉
http://xahlee.org/UnixResource_dir/writ/notations_mma.html

> 2) it assumes do loops in scheme are imperative programming

Of course it is. Look at the big picture. “Do loop” in any lang is arguably imperative.

> Schemers are a pretty desunited group.  Many in the Racket group don't
> go along with other implementors, like the guy who proposed for a
> previous RNRS the DO macro as a shortcut for a named let.  DO is no
> more of a imperative artifact than a named LET because it is a named
> let, which in turn is just a function call with more conveniently
> placed bindings.  But thanks to lame politics, it's got bad rap.
>
> Plus, Guido wasn't mocking, he was being pragmatic and many of his
> points were valid points, like the fact that tail-recursion makes for
> lame debugging.

From a few articles i read of Guido, it's pretty clear to everyone he does not have sufficient experience in functional programing to criticize it.

basically, his article on wanting to chop lambda pretty much just says “i don't grok functional notations, i prefer syntax that contain hints telling me what it does”.

> Lisp guys should hear most complaints and fix whatever perceived bad
> lisp lisp got.  Reducing parenthesis usage

yes but not by special case syntaxes. Either stick with the existing 99% regular paren syntax, or create a sysematic M-expression transformation, such as Mathematica.

> and reducing long abstract
> names of functions like "call-with-current-continuation" or "sqlite-
> query/effect-set" would be a beginning (and renaming such aberrations
> in an import was a welcome addition of R6RS), as would be providing
> automatic function dispatch on type of arguments so we could get far
> shorter function names thanks to function overloading -- make-
> datatypefoo, length-datatypefoo, read-datatypefoo is not really
> acceptable anymore in this day and age... why not simply (length foo),
> (read foo) etc?
>
> Also, something C headers just beats all languages out there:
> function prototypes.  You read them, you know what types get in and
> what types get out.  You open a Scheme R6RS lib and you see a name in
> the export list, then you need to dig for it in the source to figure
> out the parameters and try to guess what it does by peeking at the
> code... java is another stinker which decided to get rid of function
> prototypes, but at least it provides plenty of automatic IDE tools to
> do the digging for you and report the prototypes right in your nose...

Scheme lisp disappointed me very much. I don't think i'll have anything to do with Scheme again in my life, and i don't think it'll go anywhere by a iota. Maybe the Racket with the name change will go somewhere, but i think in a blink of eye i'd hop onto Clojure, newLISP, OCaml, F#, Ruby, Q/Pure, Erlang, Haskell, then i'd touch Scheme again. Currently, the ones i really want to have some serious working knowledge is OCaml/F#, for my math, theorem proving, geometry visualization, related tasks...

• 〈Language, Purity, Cult, and Deception〉
http://xahlee.org/UnixResource_dir/writ/lang_purity_cult_deception.html

plain text version follows.
--------------------------------------------------
Language, Purity, Cult, and Deception

Xah Lee, 2009-01-24

[this essay is roughly a 10 years personal retrospect of some languages, in particular Scheme and Haskell.]

I learned far more Ocaml in the past 2 days than the fucking 2 months i tried to learn Haskell, with 10 years of “I WANT TO BELIEVE” in haskell.

The Haskell's problem is similar to Scheme lisp, being academic and of little industrial involvement. About 10 years ago, during the dot com era around 1999, where scripting war was going on (Perl, tcl, Applescript, Userland Frontier, with in the corner Python, Ruby, Icon, Scheme, in the air of Java, HTML 3, CSS, CGI, javascript), i was sold a lie by Scheme lisp. Scheme, has a aura of elegance and minimalism that's one hundred miles in radius. I have always been a advocate of functional programing, with a heart for formal methods. Scheme, being a academic functional lang, has such a association. At the time, Open Source and Linux have just arrived on the scene in uproars, along with Apache & Perl. The Larry Wall scumbag and Eric Raymond fuckface and Linus T moron and Richard Stallman often appear in interviews in mainstream media. Richard Stallman's FSF with its GNU, is quick to make sure he's not forgotten, by a campaign on naming of Linux to GNU/Linux. FSF announced that Scheme is its chosen scripting lang for GNU system. Plans and visions of Guile — the new Scheme implementation, is that due to Scheme Lisp's power will have lang conversion abilities on the fly so programers can code in any lang anywhere in the GNU OS — like today's Microsoft “.NET”. Around that time, i also wholeheartedly subscribed to some A Brave Gnu World bulletin of FSF with high expectations.

Now, it's 2009. Ten years have passed. Guile disappeared into oblivion. Scheme is tail recursing in some unknown desert. PHP, one of the ugly kludge pidgin, practically and quietly surpassed the huckstered Perl in early 2000s to become the top 5 languages. (remember? Larry Wall scumbag said P is for “Practical”. PHP's got two “P”s.) Python has surfaced to became a mainstream. Ruby is the new hipster on the block. Where is Scheme? O, you can still hear these idiots continuationing tail recursions among themselves in newsgroups. Tail recursion! Tail recursion! And their standard the R6RS in 2007, by their own consensus, is one fucked up shit.

In 2000, i was a fair expert of unix technologies. Sys admin to several data center's solaris boxes each costing 40 grands. Master of Mathematica and Perl but don't know much about any other lang or langs in general. Today, i am a expert of about 5 languages and working experience with tens or so diverse ones. There is nothing in Scheme i'd consider elegant, not remotely, even if we only consider R4RS.

Scheme, like other langs with a cult, sold me a lie that lasted 10 years. Similarly, Haskell fucked me with a lure of “no assignment”. You can try to learn the lang for years and all you'll learn is that there's something called currying and monad.

In 2005, i spent a year to learn Python. Perl is known for its intentional egregious lies, lead by the demagogue Larry Wall. It fell apart unable to sustain its “post-modernistic” sophistry. To me, Python have always seemed a antidote to Perl, until you walked in. You learned that the community is also culty, and is into certain grand visions on beauty & elegance with its increasingly complex syntax soup with backward incompatible python 3.0. The python fuckheads sport the air of “computer science R us”, but their intelligence is about the same level of Perl monger idiots. (Schemers and Haskell book authors at least know what they are talking about. They are just ignorant outside of academia.)

I think my story can teach tech geekers something. In my experience, the langs that are truely a joy to learn and use, are those sans a cult. Mathematica, javascript, PHP, are all extremely a joy to use. Anything you want to do or learn how to do, in so far that the lang is suitable, can be done quickly. Their docs are to the point. And today i have to include Ocaml. It's not about whether the lang is functional, or whether the lang is elegant, or what theoretical advantage it has. Also, lang of strong academic background such as Scheme and Haskell are likely to stay forever there, regardless what is the technical nature of the lang. The background of the community, makes half what the language is.

The above is not a terrible insight, but i suppose it should be useful for some application. Today, there's huge number of languages, each screaming ME! To name a few that are bubbled up by tech geekers: Arc, Clojure, Scalar, F#, Erlang, Ruby, Groovy, Python 3, Perl6. (for a big list, see: Proliferation of Computing Languages) So, if i want to learn another lang down the road, and wish it to be a joy to use, usable docs, large number of usable libraries, well supported, a community that is not looping eternally around estheticalities, then which one should i buy? I think Erlang, OCaml/F#, would be safe choices, while langs like Qi, Oz, Arc, Perl6, would be most questionable.

Disclaimer: All mentions of real persons are opinion only.Related:

Xah ∑ xahlee.org ☄

Mark Tarver, Qi lang, Marketing

2010-09-24

On Sep 24, 1:18 am, p...@informatimago.com (Pascal J. Bourguignon) wrote:
> Isaiah Gilliland writes:
> > Lisp definitely needs a badass logo. It's not really marketing it's
> > like a flag. Something visual that everybody can bond together over
> > and paste on forums/get tattooed. A cool logo helps newcomers too,
> > because seeing the code doesn't lol. I remember first looking at CL
> > code when I was just interested, got some vertigo and had to stop haha.
>
> It has.  http://www.lisperati.com/logo.html

my fav is this classic

• 〈LISP Logo〉
http://xahlee.org/emacs/lisp_logo.html

another is:

• 〈Qi Language Logo〉
http://xahlee.org/emacs/qi_logo.html

but i think Mark (Tarver) is really a bad marketer. Qi could be great but it's barely heard.

Mark started to use the logo in their online forum about a couple years ago:
http://groups.google.com/group/qilang

but it really needs to go onto its home page:
http://www.lambdassociates.org/

(btw, the home page is badly designed. Just compare it to
http://clojure.org/
http://newlisp.org/
)

the few times i chatted to Mark (hi Mark), i recall the impression i got from him is “i don't know where to use the logo”. About a year later he used it on the Qi forum and told me about it, which is fantastic and am very happy. But the most obvious place is the home page, and any publication associated with the lang. I mean, that's what logo is for.

i couldn't understand it. At first i thought maybe he doesn't really want to associate Qi with logo from a “troll”. But apparantly he does like it and would use it on the forum.

a few times in the past couple years i had the pleasure to browser some of his essays.
e.g.

http://www.lambdassociates.org/blog/index.htm

look at that war time photo, and a bunch of quite personal essays such as “why i'm not a professor”, linked directly from the front page. That really puts a dent on public image.

That needs to go. Perhaps to his personal site with a different domain. Or, actually, Qi should have its own domain, qilang.org or qilisp.org.

By the few essays i've read, he designed Qi because he wanted to revive lisp, and bring it head to head to modern functional langs such as ML/Haskell, and wish it wide-spread. By his analysis, he thought the first step in in academia. So, in that respect he is not like some other lang creators who take the attitude of “i did it purely for myself and couldn't careless anyone else uses it”.

I think Qi could be a great fix or improvement to Common Lisp. You know, other new lisps (Clojure, newLISP, Arc, Racket) are all not Common Lisp, and they are all doing good jobs in bringing wide awareness of lisp (Clojure being concurrency & JVM, newLISP for good scripting, Arc by Paul's fame (focusing on web app i think), Racket by PLT Scheme's established community and now a new name). Only Qi, takes lisp to a new level in a CL compatible way, only if the marketing could be improved a bit and if CL people would be more supportive.

Xah ∑ xahlee.org ☄