Hokkaido.pm#11

7a8922191c1fa60728589a3def4c179f?s=47 akiym
December 28, 2013

 Hokkaido.pm#11

Cocoa module, perl-5.19

7a8922191c1fa60728589a3def4c179f?s=128

akiym

December 28, 2013
Tweet

Transcript

  1. 7.
  2. 9.

    

  3. 10.

    (JUIVC w .BD,FZCPBSE-&%  $PDPB%JDUJPOBSZ4FSWJDFT Q6OB[V$IBO  $PDPB(VJ5FTU "OZ&WFOU-FBQ.PUJPO 

    "NPO8FC%JTQBUDIFS%7  5FYU1JDP5FNQMBUF  888'$7JEFP%PXOMPBE  (BNFT1JDSPTT 5FYU$IJOFTF/VNFSBMT+"  *SPI
  4. 12.
  5. 13.

    

  6. 19.

    CVJMEFS.Z#VJMEFSQN package builder::MyBuilder; use strict; use warnings; use parent qw(Module::Build);

    use File::Copy; ! sub new { my ($self, %args) = @_; $self->SUPER::new( %args, extra_compiler_flags => ['-Wall'], extra_linker_flags => ['-framework', 'Foundation'], ); } GSBNFXPSLͷϦϯΫ
  7. 20.

    CVJMEFS.Z#VJMEFSQN sub compile_c { my ($self, $file, %args) = @_;

    ! (my $m_file = $file) =~ s/\.c$/.m/; move($file, $m_file) or die $!; ! $self->SUPER::compile_c($m_file, %args); } ! 1;
  8. 25.

    σʔλͷม׵ # e.g. NSString → SVPV ! SV* sv =

    sv_2mortal(newSV(0)); sv_setpv(sv, [str UTF8String]);
  9. 26.

    Ͱ

  10. 30.

    

  11. 31.
  12. 35.

    IBTITMJDFTZOUBY my %h = ( blonk => 2, foo =>

    3, squink => 5, bar => 8, ); my %subset = %h{qw/foo bar/}; # => (foo => 3, bar => 8)
  13. 39.

    σʔλߏ଄ my $foo = { bar => { baz =>

    { a => 1, b => 2, c => 3, } } }; !
  14. 40.

    σʔλߏ଄ my $foo = { bar => { baz =>

    { a => 1, b => 2, c => 3, } } }; ! my @ab = @{$foo->{bar}{baz}}{qw/a b/}; # => [1, 2] ஍ࠈͬΆ͍
  15. 41.

    σʔλߏ଄ my $foo = { bar => { baz =>

    { a => 1, b => 2, c => 3, } } }; ! my @ab = $foo->{bar}{baz}->@{qw/a b/}; # => [1, 2]
  16. 42.

    :PV5VCF%BUB"1* $VAR1 = { 'fmt' => '36', 'fmt_list' => [

    '36', '18', '5', '43', '17' ], 'resolution' => '320x240', 'suffix' => 'flv', 'title' => 'HE-MAN HEYEAYEA SONG FOR 10 HOURS', 'user' => undef, 'video_id' => 'eh7lp9umG2I', 'video_url' => ..., 'video_url_map' => { '17' => { 'fmt' => '17', 'resolution' => '176x144', 'suffix' => '3gp', 'url' => ... }, '18' => { 'fmt' => '18', 'resolution' => '320x240',
  17. 46.

    w QSPUPUZQFBUUSJCVUF w sub foo($$){}ˠsub foo : prototype($$){} w Perl

    5.19.2から $!が decodeされる w http://d.hatena.ne.jp/syohex/ 20131227/1388149250
  18. 49.

    ͜ͷίʔυ͸ಈ͘ʁ # メモリは十分にあるとする # perl-5.18.1 (64bit) ! my @a; $a[2**31]

    = 1; ! # => Modification of non-creatable array value attempted, subscript -2147483648 ಈ͔ͳ͍
  19. 50.

    QFSMҎ߱ͳΒ my @a; $a[2**31] = 1; ! # On 64-bit

    platforms, the internal array functions now use 64-bit offsets, allowing Perl arrays to hold more than 2**31 elements, if you have the memory available.
  20. 52.

    w .PEVMF1MVHHBCMF w 0CKFDU"DDFTTPS w 1PE-B5F9 w 5FSN6* w 5FYU4PVOEFY

    SFNPWFENPEVMFT w "SDIJWF&YUSBDU w #-JOU w $1"/1-64 w 'JMF$IFDL5SFF w -PH.FTTBHF