Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: RFC: Is there more to alias?

by Solo (Deacon)
on Aug 25, 2004 at 16:59 UTC ( [id://385744]=note: print w/replies, xml ) Need Help??


in reply to Re: RFC: Is there more to alias?
in thread RFC: Is there more to alias?

Attempting to follow xmath's advice and try myself. Unfortunately, I'm out of my league with xs compilation errors. (I can build Date::Calc, so it's not an environment problem.)

Are there compiler options I'm missing?

>nmake Microsoft (R) Program Maintenance Utility Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. cl -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSO +LE -DNO_S RICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT -DPERL_I +MPLICIT_S S -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION +=\"0.03_0 \" -DXS_VERSION=\"0.03_09\" "-IE:\Perl\lib\CORE" Alias.c Alias.c Alias.xs(1153) : warning C4244: '=' : conversion from 'PADOFFSET' to ' +U16', pos ible loss of data Alias.xs(1458) : error C2143: syntax error : missing ';' before 'type' Alias.xs(1459) : error C2275: 'SV' : illegal use of this type as an ex +pression E:\Perl\lib\CORE\perl.h(1774) : see declaration of 'SV' Alias.xs(1459) : error C2065: '_da' : undeclared identifier Alias.xs(1459) : error C2065: '_dap' : undeclared identifier Alias.xs(1459) : error C2100: illegal indirection Alias.xs(1459) : error C2100: illegal indirection Alias.xs(1461) : warning C4047: '=' : 'int' differs in levels of indir +ection fr m 'SV ** ' Alias.xs(1461) : error C2100: illegal indirection Alias.xs(1461) : error C2223: left of '->sv_flags' must point to struc +t/union Alias.xs(1461) : warning C4047: 'function' : 'SV *' differs in levels +of indire tion from 'int' Alias.xs(1461) : error C2223: left of '->sv_any' must point to struct/ +union Alias.xs(1462) : error C2223: left of '->sv_any' must point to struct/ +union Alias.xs(1463) : error C2223: left of '->sv_any' must point to struct/ +union Alias.xs(1464) : error C2065: 'initialized' : undeclared identifier NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop. Summary of my perl5 (revision 5 version 8 subversion 4) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultip +licity=def ine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D +_CONSOLE - DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT - +DPERL_IMPL ICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksi ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"E: \Perl\lib\CORE" -machine:x86' libpth=C:\PROGRA~1\MICROS~3\VC98\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32 .lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uui +d.lib wsoc k32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt. +lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comd lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib + uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msv +crt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf - libpath:"E:\Perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL +_IMPLICIT_ CONTEXT PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 810 22751 Update to Test.pm 1.25 21540 Fix backward-compatibility issues in if.pm Built under MSWin32 Compiled at Jun 1 2004 11:52:21

--Solo

--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Replies are listed 'Best First'.
Re^3: RFC: Is there more to alias?
by xmath (Hermit) on Aug 25, 2004 at 18:05 UTC
    I think I've fixed the problem, and I've uploaded a fresh version. See if this helps.

    As for your original questions.. I have read your original post several times, and I have honestly no idea what you're trying to accomplish....

    for alias my $line (<DATA>) {}
    This is a syntax error. And "for" already aliases, so what's the deal here? On top of that, why would you need an alias to the temporary var that contains the line anyway?

    alias my $line = <DATA>; while ( defined( alias my $line = <DATA> ) ) {}
    These work, but again I don't see the point.. why alias $line to the read line? To prevent copying the line? I think perl already optimizes that away.

    Maybe I'm just missing something, in which case please enlighten me.

      Thanks, I'll try the new version.

      And I don't think you're missing anything... hope I didn't make you spin too many cycles on that.

      As I said it was a curiosity: A way to give $_ a 'pretty name' in a for or while loop. You're saying it's already the same to do:

      for $line (<DATA>) {} # or for alias $line (<DATA>) {}

      Ok. /shrug. I naively saw the named subroutine arguments as roughly the same thing. I am enlightened. =)

      --Solo

      --
      You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://385744]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-20 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found