ã¾ãã¾ãã¿ã¤ãã³ã°é ããªããã§å¤§æ¹ã®è¨èªã¯åºå°½ãããæããã£ããã ãã©ãã¾ã 誰ããã£ã¦ãªãè¨èªããã£ãã®ã§ããã£ã¦ã¿ãã
! ! X / _ / X < :æ¥é±ãè¦ã¦ãã ããã! ! module yuno logical :: X = .true. interface operator(/) module procedure f1, f2 end interface interface operator(<) module procedure f3 end interface contains logical function f1(a, b) logical, intent(in) :: a, b f1 = .true. end function logical function f2(a, b) logical, intent(in) :: a character(*), intent(in) :: b f2 = .true. end function logical function f3(a, b) logical, intent(in) :: a character(*), intent(in) :: b write(*,*) "ã²ã ã¾ãã¹ã±ããÃ365 ", b f3 = .true. end function end module program main use yuno X = & X / '_' / X < "æ¥é±ãè¦ã¦ãã ããã!" end
% gfortran -v Using built-in specs. Target: i686-pc-cygwin ã³ã³ãã£ã°ãªãã·ã§ã³: ../gcc44/configure --prefix=/usr/local/gfortran --enable-languages=c,fortran --disable-bootstrap --enable-threads=posix --enable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-nls --disable-libmudflap --disable-shared --disable-win32-registry --with-system-zlib --enable-checking=release --enable-werror --without-included-gettext --without-x --enable-libgomp ã¹ã¬ããã¢ãã«: posix gcc version 4.4.0 20080517 (experimental) [trunk revision 135459] (GCC) % gfortran yuno.f95 % ./a.exe ã²ã ã¾ãã¹ã±ããÃ365 æ¥é±ãè¦ã¦ãã ããã! %
ããã§ããï¼ãããã¾ãããï¼ï¼
(99.99% ã®äººã¯ç¥ã£ã¦ãããªãã¦ãçæ´»ã«å
¨ç¶åé¡ãªã) è¦å´ããç¹ã«ã¤ãã¦ãã¾ã¨ãã¦ããã*1
- èå¥åã®å é ã« _ ã¯ä½¿ããªãä»æ§ããã (ä»æ¹ãªãåä¸å¼ç¨ç¬¦ã§æåå)ã: ãã©ãããããæãã¤ããªãã£ãã®ã§åé¤ãæ¥æ¬èªãæåååã
- _ ã®æååã®ããã§å©ç¨è å®ç¾©æ¼ç®å / ã 2 㤠((logical, logical) 㨠(logical, character(*))) å¿ è¦ã«ãªã£ãã_ ã使ããã«å¥ã®æåã«ããã°ãå¤æ°ã«ã§ãããããå©ç¨è å®ç¾©æ¼ç®å / ã¯åè 1 ã¤ã®ã¿ã§ã§ããã¨æãããã
logical :: Y = .true. X = & X / Y / X < "æ¥é±ãè¦ã¦ãã ããã!"
- å©ç¨è å®ç¾©æ¼ç®åã¯å¤éå®ç¾©ã¯ã§ãããã©ãåå®ç¾©ã¯ã§ããªãããããã¤ã¾ã / ã¨ã < ã¯ä¸¡è¾ºã« integer ãç½®ããããæ®éã«é¤ç®ã¨ãå°ãªããæ¼ç®ããããããã®æåãå¤æ´ãããã¨ã¯ã§ããªããã©ãlogical ã¨ã character(*) ã«å¯¾ããæ¼ç®ã¯å ã å®ç¾©ããã¦ããªããããinterface operator ã§å¤éå®ç¾©ãããã¨ãã§ããã¿ããã
*1:ãããããã gfortran ç¹æã®è©±ãããããªãã