unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* pack/unpack perl like functions ?
@ 2006-11-22 11:41 Xavier Maillard
  2006-12-18 20:29 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xavier Maillard @ 2006-11-22 11:41 UTC (permalink / raw)


Hi,

I have already asked this question but not here.

I am looking for pack/unpack perl-like functions in elisp.

unpack takes a string and expands it out as a list of values
(pack does the opposite).

Are you aware of something like this ?

Regards
-- 
Xavier

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

* Re: pack/unpack perl like functions ?
  2006-11-22 11:41 pack/unpack perl like functions ? Xavier Maillard
@ 2006-12-18 20:29 ` Stefan Monnier
  2006-12-18 23:44 ` Kevin Rodgers
  2006-12-19  9:45 ` Kim F. Storm
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2006-12-18 20:29 UTC (permalink / raw)
  Cc: emacs-devel

> unpack takes a string and expands it out as a list of values
> (pack does the opposite).

What's "a list of values"?

> Are you aware of something like this ?

I guess `prin1' is similar to `pack' and `read' is then like `unpack'.


        Stefan

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

* Re: pack/unpack perl like functions ?
  2006-11-22 11:41 pack/unpack perl like functions ? Xavier Maillard
  2006-12-18 20:29 ` Stefan Monnier
@ 2006-12-18 23:44 ` Kevin Rodgers
  2006-12-19 10:53   ` Johan Bockgård
  2006-12-19  9:45 ` Kim F. Storm
  2 siblings, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2006-12-18 23:44 UTC (permalink / raw)


Xavier Maillard wrote:
> Hi,
> 
> I have already asked this question but not here.
> 
> I am looking for pack/unpack perl-like functions in elisp.
> 
> unpack takes a string and expands it out as a list of values
> (pack does the opposite).
> 
> Are you aware of something like this ?

(append "foo" nil) => (102 111 111)

(equal '(102 111 111) '(?f ?o ?o)) => t

(apply 'string '(?f ?o ?o)) => "foo"

-- 
Kevin

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

* Re: pack/unpack perl like functions ?
  2006-11-22 11:41 pack/unpack perl like functions ? Xavier Maillard
  2006-12-18 20:29 ` Stefan Monnier
  2006-12-18 23:44 ` Kevin Rodgers
@ 2006-12-19  9:45 ` Kim F. Storm
  2 siblings, 0 replies; 5+ messages in thread
From: Kim F. Storm @ 2006-12-19  9:45 UTC (permalink / raw)
  Cc: emacs-devel

Xavier Maillard <zedek@gnu.org> writes:

> Hi,
>
> I have already asked this question but not here.
>
> I am looking for pack/unpack perl-like functions in elisp.
>
> unpack takes a string and expands it out as a list of values
> (pack does the opposite).
>
> Are you aware of something like this ?

Emacs 22 has bindat.el

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: pack/unpack perl like functions ?
  2006-12-18 23:44 ` Kevin Rodgers
@ 2006-12-19 10:53   ` Johan Bockgård
  0 siblings, 0 replies; 5+ messages in thread
From: Johan Bockgård @ 2006-12-19 10:53 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> (apply 'string '(?f ?o ?o)) => "foo"

(concat '(?f ?o ?o))

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

end of thread, other threads:[~2006-12-19 10:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-22 11:41 pack/unpack perl like functions ? Xavier Maillard
2006-12-18 20:29 ` Stefan Monnier
2006-12-18 23:44 ` Kevin Rodgers
2006-12-19 10:53   ` Johan Bockgård
2006-12-19  9:45 ` Kim F. Storm

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).