Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evalexpr?evaltrue:evalfalse would like evaltrue defaulted by evalexpr #2243

Closed
p5pRT opened this issue Jul 20, 2000 · 4 comments
Closed

evalexpr?evaltrue:evalfalse would like evaltrue defaulted by evalexpr #2243

p5pRT opened this issue Jul 20, 2000 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 20, 2000

Migrated from rt.perl.org#3559 (status was 'resolved')

Searchable as RT3559$

@p5pRT
Copy link
Author

p5pRT commented Jul 20, 2000

From mar@cf.nettuno.it

This is a bug report for perl from mar@​cf.nettuno.it,
generated with the help of perlbug 1.28 running under perl v5.6.0.


This is not a bug, but an usefull and easy enhancement -i think​:
the syntax and use of
  evalexpr?evaltruecase​:evalfalsecase
can be enhanced with the capability of absence of evaltruecase expression

this absence can return by default the value of evalexpr

having
  evalexpr?​:evalfalsecase
similar but more efficient that (typical...)
  evalexpr?evalexpr​:evalfalsecase

actually perl returns syntax error near "?​:"

for efficency and code more light

All the best,
Marco Munari <mar@​chiara.dei.unipd.it>
--
/~v~~\ .​::​: ... Marco Munari ... :​::​::​::​::​::​::​::​::​:: Univers. :​::.
\_ */ :​:: mailto​:mar@​cf.nettuno.it?subject=.signature :​:
.\..\. :​: :​:
  \A ...​::​: :​:
  YV :​:: "Progress is implicitly due to perfect exceptions" :​::
  / \ :​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​::​:.
x(t),y(t) = th(3t-34.5)*e^[-(3t-34.5)^2]/2-4.3+e^(-1.8/t^2)/(.8*atg(t-
3)+2)(t-1.8)-.3th(5t-42.5),(1.4e^[-(3t-34.5)^2]+1-sgn[|t-8.5|-.5]*1.5*
|sin(pi*t)|^[2e^(-(t-11.5)^2)+.5+e^(-(.6t-3.3)^2)])/(.5+t)+1 ; 0<t<14



Flags​:
  category=core
  severity=none


Site configuration information for perl v5.6.0​:

Configured by pixel at Fri Mar 31 16​:32​:49 CEST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration​:
  Platform​:
  osname=linux, osvers=2.2.15-0.16mdksmp, archname=i386-linux
  uname='linux kenobi.mandrakesoft.com 2.2.15-0.16mdksmp #1 smp mon mar 13 16​:40​:10 cet 2000 i686 unknown '
  config_args='-des -Dprefix=/usr -Darchname=i386-linux -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Ud_csh -Dman3dir=/usr/lib/perl5/man/man3 -Doptimize=-O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s -mpentium -mcpu=pentium -march=pentium -ffast-math -fexpensive-optimizations'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=undef d_sfio=undef uselargefiles=define
  use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler​:
  cc='cc', optimize='-O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s -mpentium -mcpu=pentium -march=pentium -ffast-math -fexpensive-optimizations', gccversion=2.95.3 19991030 (prerelease)
  cppflags='-fno-strict-aliasing'
  ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
  stdchar='char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib
  libs=-lnsl -ldl -lm -lc -lposix -lcrypt
  libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
  cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches​:
 


@​INC for perl v5.6.0​:
  /usr/lib/perl5/5.6.0/i386-linux
  /usr/lib/perl5/5.6.0
  /usr/lib/perl5/site_perl/5.6.0/i386-linux
  /usr/lib/perl5/site_perl/5.6.0
  /usr/lib/perl5/site_perl/5.005/i386-linux
  /usr/lib/perl5/site_perl/5.005
  /usr/lib/perl5/site_perl
  .


Environment for perl v5.6.0​:
  HOME=/home/mar
  LANG=en
  LANGUAGE=en
  LC_ALL=en
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/local/bin​:/bin​:/usr/bin​:/opt/jdk-1.2.2/bin​:/usr/X11R6/bin​:/home/mar/bin​:/opt/jdk-1.2.2/bin​:/usr/X11R6/bin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jul 21, 2000

From [Unknown Contact. See original ticket]

Marco Munari <mar@​cf.nettuno.it> wrote

having
evalexpr?​:evalfalsecase
similar but more efficient that (typical...)
evalexpr?evalexpr​:evalfalsecase

The || operator already does exactly what you are asking for.

Mike Guy

@p5pRT
Copy link
Author

p5pRT commented Jul 21, 2000

From [Unknown Contact. See original ticket]

On 20 Jul 2000, Marco Munari wrote​:

having
evalexpr?​:evalfalsecase
similar but more efficient that (typical...)
evalexpr?evalexpr​:evalfalsecase

perhaps you want the equivalent (and currently legal)​:

  $val = evalexpr || evalfalsecase;

-Aaron

@p5pRT
Copy link
Author

p5pRT commented Jul 25, 2000

From @ysth

In article <Pine.A41.4.05.10007210845000.67816-100000@​node13.unix.Virginia.EDU>,
Aaron J Mackey <ajm6q@​virginia.edu> wrote​:

On 20 Jul 2000, Marco Munari wrote​:

having
evalexpr?​:evalfalsecase
similar but more efficient that (typical...)
evalexpr?evalexpr​:evalfalsecase

perhaps you want the equivalent (and currently legal)​:

$val = evalexpr || evalfalsecase;

Subtle difference​: C<a ? a : b> gives boolean context to the first a.
The second a and the b get whatever context comes from the outside.
C<a || b> gives scalar context to the a, while b gets its context from
the outside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant