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

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

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
January 14, 2013 19:22
Subject:
[perl #116366] [PATCH] better POD for unpackstring
Message ID:
rt-3.6.HEAD-4370-1358191364-886.116366-15-0@perl.org
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@173.199.227.254) 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; http://perl5.git.perl.org/perl.git/commit/3041a168
03[11:43] * stevan (~stevan@173.199.227.254) has joined #p5p
03[11:43] * clunker3 sets mode: +o stevan
02[11:50] * denisboyun (~quassel@66-197-135-95.pool.ukrtel.net) Quit
(Ping timeout: 360 seconds)
01[11:53] <@bulk88> http://perl5.git.perl.org/perl.git/commit/3041a168
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 hotmail.com

---
via perlbug:  queue: perl5 status: resolved
https://rt.perl.org:443/rt3/Ticket/Display.html?id=116366

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About