From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: Need advice for naming practice for namespaces in Elisp. Date: Thu, 07 Feb 2013 21:04:29 +0200 Organization: Oleksandr Gavenko , http://gavenkoa.users.sf.net Message-ID: <87pq0cx7wi.fsf@gavenkoa.example.com> References: <87ehguo5ha.fsf@gavenkoa.example.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1360263912 26470 80.91.229.3 (7 Feb 2013 19:05:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Feb 2013 19:05:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 07 20:05:32 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U3Wml-0007sc-2r for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Feb 2013 20:05:27 +0100 Original-Received: from localhost ([::1]:46983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3WmO-0000XK-0h for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Feb 2013 14:05:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:32905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3WmF-0000WM-C5 for help-gnu-emacs@gnu.org; Thu, 07 Feb 2013 14:04:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3Wm3-0008QS-5m for help-gnu-emacs@gnu.org; Thu, 07 Feb 2013 14:04:55 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:36810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3Wm2-0008QK-VD for help-gnu-emacs@gnu.org; Thu, 07 Feb 2013 14:04:43 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U3WmI-0007LO-Ul for help-gnu-emacs@gnu.org; Thu, 07 Feb 2013 20:04:58 +0100 Original-Received: from 37.229.4.200 ([37.229.4.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Feb 2013 20:04:58 +0100 Original-Received: from gavenkoa by 37.229.4.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Feb 2013 20:04:58 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 100 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 37.229.4.200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:lQI3YbnF8j7cJAQiBdyIkbsPVJY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89006 Archived-At: On 2013-02-06, Stefan Monnier wrote: >> I read very small amount of elisp code and found practice to put '->' >> in the name of elisp var/func: > > I use -> sometimes, typically for access to a struct's fields. > This comes from my learning lispy languages via Scheme. > Thanks for interesting answer! >> Also I search for dot in names: > > I (strongly) recommend against the use of "." in symbols. > "(erc-response.sender)" could also be interpreted as "(erc-response > . sender)" and historically Elisp has not been very good at resolving > this ambiguity in a reliable way. > OK. Thanks for advice. I start from dot as separator to mimic OOP language syntax... And found that evaluation of: (defun foo.?bar () ()) by C-x C-e produce: foo\.bar in message buffer. Same for 'foo?bar' name. Why '\.' or '\?' was printed? (info "(elisp)Symbol Type") have: A symbol name can contain any characters whatever. Most symbol names are written with letters, digits, and the punctuation characters `-+=*/'. Such names require no special punctuation; the characters of the name suffice as long as the name does not look like a number. (If it does, write a `\' at the beginning of the name to force interpretation as a symbol.) The characters `_~!@$%^&:<>{}?' are less often used but also require no special punctuation. Any other characters may be included in a symbol's name by escaping them with a backslash. >> and for colon: > > Colon is typically used in a Common-Lisp way, to separate the "module > name" from the specific definition. > >> Seems that official sources don't often use special marker to separate >> package name and command and some times uses '->', ':' and '.' > > Common usage is to use "-". > I complete agree. Also I forget to mention about '/' char: ./cedet/ede/ede-locate.el:307: (cedet-idutils-create/update-database root)) ./cedet/ede/ede-locate.el:347: (cedet-cscope-create/update-database root)) And become understand that really have another question... I write code which have distinct parts, so use prefixes: blog4y blog4y-chuck blog4y-serv I want be able to recognise them from each other, so instead of: blog4y-init ; blog4y blog4y-chunk-write ; blog4y-chunk blog4y-serv-show ; blog4y-serv use something like: blog4y-init ; blog4y blog4y-chunk:write ; blog4y-chunk blog4y-serv:show ; blog4y-serv But this code is ugly: blog4y-serv:mode blog4y-serv:mode-map blog4y-serv:font-lock-keywords and break elisp conventions... So what I really need is to make prefix visible and distinct from rest part of name, like: blog4y-init ; blog4y blog4y*chunk-write ; blog4y*chunk blog4y*serv-show ; blog4y*serv or use any other `-+=*/_~!@$%^&:<>{}?' allowed non-usual symbol. Seems that any personal choice will be good... Again thanks all for replays! -- Best regards!