develooper Front page | perl.perl5.porters | Postings from January 2013

[perl #116366] [PATCH] better POD for unpackstring

Thread Previous | Thread Next
bulk88 via RT
January 14, 2013 19:22
[perl #116366] [PATCH] better POD for unpackstring
Message ID:
On Mon Jan 14 05:04:42 2013, davem wrote:
> I'm not very keen on this change. I've never heard the perl stack
> referred
> to as the '@_ stack' before. I'd suggest just calling it 'the perl
> stack'
> (yes, perl has several stacks, but the PL_stack_sp stack is the only
> one
> you would normally expect to push values onto). Or perhaps 'the
> argument
> stack', which is what xstut.pod does.

I didn't get an answer on IRC when I asked if the Perl stack has a more
formal name. "the stack" might mean C stack since unpackstring takes no
Perl stack args. unpackstring is an idiosyncrasy. Someone might think,
if it takes parameters on the C stack, it will return them on the C
stack. illguts uses the term "@_ stack" which sounds more specific than
"the stack" or "Perl stack", so I copied term from illguts. The term
makes sense since ->Isp appears as @_ in Perl lang. I am not advocating
replacing all mentions of "the stack" or "Perl stack" with "@_ stack",
but only where there is ambiguity like with unpackstring.

01[11:24] <@bulk88> what is the name of the perl stack, "Perl stack" or
"@_ stack"?
02[11:34] * @stevan (~stevan@ Quit (Remote host
closed the connection)
06[11:41] * p5commits Dave Mitchell pushed to blead
(v5.17.7.0-287-g3041a16): David Mitchell: include SvREADONLY() in
SvIMMORTAL() test;
03[11:43] * stevan (~stevan@ has joined #p5p
03[11:43] * clunker3 sets mode: +o stevan
02[11:50] * denisboyun ( Quit
(Ping timeout: 360 seconds)
01[11:53] <@bulk88>
immortals yes no and undef are sequential in the interp, why not just >
and < them? 
*room goes offtopic*

> The PUSHMARK thing I find totally confusing.  I guess you're trying to
> say
> that the function won't pop a mark?? In which case maybe something
> like:
>     The function does not take any values from the argument stack, nor
>     does it pop any marks.

It takes alot of knowledge of internals to figure out "dont do a
PUSHMARK" from "it does not pop any marks".*pretends to be someone new
with XS* What is a mark? what "argument stack"? C? C vararg? *look at C
prototype*, hmm can't be C because of the prototype, they must've meant
@_, Perl XS is horrible!!!! [wasted extra seconds thinking]

perlguts doesn't mention marks ("You are responsible for ensuring that
your op takes the appropriate number of values from the stack, and you
are responsible for adding stack marks if necessary." the only mention
doesn't explain anything). perlhack doesn't mention marks. perlcall just
says "always do it to signal that this is the start of the parameter
list", it doesn't describe the internal operation of the stack mark
system or what a mark is. For an explanation you would have to read
illguts. illguts doesn't mention what removed the mark from the stack
either (it does say how its added). Most people copy paste macro heavy
XS code from perlcall since they don't and don't want to understand it
just to write some XS code. Saying "dont do a PUSHMARK [even though
perlcall implies you have to do it]" is alot simpler to someone who is
new. Docs should not be written to force someone to do trial and error
(segvs/panics) to figure out how to do something. Perl's XS/C docs
should be written as if Perl was closed source software, where there is
no code to read if you want a better answer.

bulk88 ~ bulk88 at

via perlbug:  queue: perl5 status: resolved

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About