unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp
@ 2015-09-29 16:43 Mark Karpov
  2015-10-01  2:26 ` Richard Stallman
  2021-12-02  9:19 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Karpov @ 2015-09-29 16:43 UTC (permalink / raw)
  To: 21584


In Common Lisp there is ‘constantly’ function:

  http://www.lispworks.com/documentation/HyperSpec/Body/f_cons_1.htm

which creates new function without side-effects that takes any number of
arguments and always returns specified value.

For some reason ‘cl-lib’ doesn't provide ‘cl-constantly’, so I guess it
should exist in pure Emacs Lisp under different name. However, I
couldn't find such a function, so I ask you to tell me name of function
that word like ‘constantly’ in Emacs Lisp or add ‘cl-constantly’ in
‘cl-lib’ in Emacs 25.



In GNU Emacs 25.0.50.21 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.7)
 of 2015-09-20
Repository revision: 6afe8168dde7780853003dea2fb9e3a8ba57e2ea
Windowing system distributor 'The X.Org Foundation', version 11.0.11702000
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ελ

Minor modes in effect:
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  rainbow-delimiters-mode: t
  hl-todo-mode: t
  whitespace-mode: t
  flyspell-mode: t
  flycheck-color-mode-line-mode: t
  flycheck-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  vimish-fold-global-mode: t
  vimish-fold-mode: t
  show-paren-mode: t
  rich-minority-mode: t
  minibuffer-electric-default-mode: t
  ido-vertical-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  highlight-line-mode: t
  global-auto-revert-mode: t
  global-aggressive-indent-mode: t
  aggressive-indent-mode: t
  display-time-mode: t
  delete-selection-mode: t
  cyphejor-mode: t
  ace-popup-menu-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  modalka-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t
  auto-fill-mode: 1

Recent messages:
Saving file /home/mark/projects/programs/emacs-lisp/para/para.el...
Wrote /home/mark/projects/programs/emacs-lisp/para/para.el
Undo! [2 times]
Mark set
Saving file /home/mark/projects/programs/emacs-lisp/para/para.el...
Wrote /home/mark/projects/programs/emacs-lisp/para/para.el
Type "q" in help window to restore its previous buffer.
Mark set
uncompressing cl-extra.el.gz...done
Note: file is write protected

Load-path shadows:
None found.

Features:
(shadow emacsbug sendmail org-rmail org-mhe org-irc org-info org-gnus
org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb
org-w3m markdown-mode hyperspec eieio-opt speedbar sb-image ezimage
dframe misearch multi-isearch zzz-to-char smex sort gnus-cite smiley
shr-color color shr dom browse-url qp mail-extr gnus-async gnus-bcklg
gnus-ml nndraft nnmh nnfolder utf-7 epa-file gnutls gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime dig nntp gnus-cache gnus-sum gnus-group gnus-undo
gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo
parse-time gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems nnheader
linum em-unix em-term term disp-table ehelp em-script em-prompt em-ls
em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias
haskell-doc inf-haskell haskell-decl-scan haskell haskell-completions
haskell-load haskell-commands highlight-uses-mode haskell-modules
haskell-sandbox haskell-repl haskell-debug haskell-interactive-mode
haskell-presentation-mode haskell-collapse haskell-navigate-imports
haskell-compile haskell-process haskell-session haskell-indentation
haskell-font-lock smartparens-haskell haskell-mode haskell-string
haskell-sort-imports haskell-lexeme haskell-align-imports haskell-compat
haskell-complete-module flymake dabbrev ace-window ebal warnings
ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init
ediff-util ediff recentf tree-widget wid-edit magit-blame magit-stash
magit-bisect magit-remote magit-commit epa magit-sequence magit esh-var
esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell
esh-module esh-mode esh-util dired-x magit-apply magit-wip magit-log
magit-diff smerge-mode magit-core magit-process magit-popup magit-mode
magit-git crm magit-section magit-utils git-commit log-edit pcvs-util
add-log with-editor async-bytecomp async cider-debug cider-mode
cider-resolve cider-browse-ns cider-inspector apropos cider-interaction
arc-mode archive-mode cider-overlays cider-test cider-stacktrace
cider-repl cider-eldoc cider-doc org-table org org-macro org-footnote
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs cal-menu calendar cal-loaddefs cider-popup cider-client
cider-common cider-util clojure-mode imenu nrepl-client derived queue
ewoc etags xref project spinner compile autoload lisp-mnt tar-mode
mm-archive message rfc822 mml mml-sec mailabbrev gmm-utils mailheader
mm-decode mm-bodies mm-encode mail-utils network-stream nsm starttls
url-http tls mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw
url-cache url-auth url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse url-vars epg vc vc-dispatcher smartparens-python python
tramp-sh tramp tramp-compat auth-source eieio eieio-core gnus-util
mm-util help-fns mail-prsvr password-cache tramp-loaddefs trampver shell
pcomplete format-spec json comint ansi-color hl-line dired vc-git
diff-mode bookmark pp rainbow-delimiters hl-todo whitespace flyspell
ispell flycheck-color-mode-line face-remap flycheck-haskell
haskell-cabal haskell-utils haskell-customize flycheck find-func rx
mk-visual smart-mode-line solarized-dark-theme solarized mk-texinfo
mk-tex mk-python mk-prolog mk-org mk-markdown mk-man mk-magit mk-lisp
mk-ibuffer mk-haskell mk-gnus mk-eshell mk-erc mk-elisp mk-dired
mk-clojure kill-or-bury-alive mk-calendar mk-c mk-minor-modes
common-lisp-snippets yasnippet cl whole-line-or-region vimish-fold paren
rich-minority minibuf-eldef ido-vertical-mode ido-ubiquitous
ido-completing-read+ cl-macs ido seq gv highlight-line autorevert
filenotify cl-seq aggressive-indent easy-mmode time delsel cyphejor
ace-popup-menu smartparens-config smartparens byte-opt thingatpt
mk-global modalka quail edmacro kmacro ace-link avy ring misc server
mk-utils subr-x f dash s ucs-normalize finder-inf tex-site fix-word
advice slime-autoloads info bytecomp byte-compile cl-extra help-mode
cl-loaddefs pcase cl-lib cconv package easymenu epg-config time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 781479 204206)
 (symbols 48 61227 1)
 (miscs 40 516 3062)
 (strings 32 153424 58089)
 (string-bytes 1 4678461)
 (vectors 16 85732)
 (vector-slots 8 2106091 65053)
 (floats 8 1124 1903)
 (intervals 56 6568 1724)
 (buffers 976 37)
 (heap 1024 88303 8794))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp
  2015-09-29 16:43 bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp Mark Karpov
@ 2015-10-01  2:26 ` Richard Stallman
  2015-10-01 12:58   ` Nicolas Petton
  2021-12-02  9:19 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2015-10-01  2:26 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 21584

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Maybe we can add 'constantly' to Emacs outside the cl package.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp
  2015-10-01  2:26 ` Richard Stallman
@ 2015-10-01 12:58   ` Nicolas Petton
  2015-10-02  2:27     ` Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Petton @ 2015-10-01 12:58 UTC (permalink / raw)
  To: rms, Mark Karpov; +Cc: 21584

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

Richard Stallman <rms@gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> Maybe we can add 'constantly' to Emacs outside the cl package.

Do you mean as a standard documented function, in subr.el?  Or maybe in
subr-x.el?

Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp
  2015-10-01 12:58   ` Nicolas Petton
@ 2015-10-02  2:27     ` Richard Stallman
  2015-10-02  4:52       ` Daniel Colascione
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2015-10-02  2:27 UTC (permalink / raw)
  To: Nicolas Petton; +Cc: 21584, markkarpov

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Maybe we can add 'constantly' to Emacs outside the cl package.

  > Do you mean as a standard documented function

Yes.

What file to put it in is a detail I am not addressing.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp
  2015-10-02  2:27     ` Richard Stallman
@ 2015-10-02  4:52       ` Daniel Colascione
  2015-10-03  1:36         ` Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Colascione @ 2015-10-02  4:52 UTC (permalink / raw)
  To: rms, Nicolas Petton; +Cc: 21584, markkarpov

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

On 10/01/2015 07:27 PM, Richard Stallman wrote:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
>   > > Maybe we can add 'constantly' to Emacs outside the cl package.
> 
>   > Do you mean as a standard documented function
> 
> Yes.
> 
> What file to put it in is a detail I am not addressing.

I thought we weren't adding unnamespaced functions anymore.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp
  2015-10-02  4:52       ` Daniel Colascione
@ 2015-10-03  1:36         ` Richard Stallman
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2015-10-03  1:36 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: nicolas, 21584, markkarpov

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I thought we weren't adding unnamespaced functions anymore.

For a general-purpose useful function, such as this one, that is 
the way to add it -- if we are going to add it.


-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp
  2015-09-29 16:43 bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp Mark Karpov
  2015-10-01  2:26 ` Richard Stallman
@ 2021-12-02  9:19 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-02  9:19 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 21584

Mark Karpov <markkarpov@openmailbox.org> writes:

> In Common Lisp there is ‘constantly’ function:
>
>   http://www.lispworks.com/documentation/HyperSpec/Body/f_cons_1.htm
>
> which creates new function without side-effects that takes any number of
> arguments and always returns specified value.
>
> For some reason ‘cl-lib’ doesn't provide ‘cl-constantly’, so I guess it
> should exist in pure Emacs Lisp under different name.

I've now added `cl-constantly' to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-02  9:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-29 16:43 bug#21584: 25.0.50; Please add cl-constantly function from Common Lisp Mark Karpov
2015-10-01  2:26 ` Richard Stallman
2015-10-01 12:58   ` Nicolas Petton
2015-10-02  2:27     ` Richard Stallman
2015-10-02  4:52       ` Daniel Colascione
2015-10-03  1:36         ` Richard Stallman
2021-12-02  9:19 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).