home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   sci.lang      Natural languages, communication, etc      297,461 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 296,115 of 297,461   
   Kaz Kylheku to HenHanna   
   Re: How do i get multiple Min() values?   
   15 Jul 24 12:27:58   
   
   XPost: comp.lang.python, comp.lang.lisp   
   From: 643-408-1753@kylheku.com   
      
   On 2024-07-12, HenHanna  wrote:   
   >>   
   >> How do i get multiple Min() values?   
   >>   
   >>            e.g.      for   Y = (x-2)*(x-3)   for x in   
   range(-10,10)   
   >>                                     the   
   min Y is hit twice   
   >>   
   >>   
   >> print(  min( ((x-2)*(x-3),  (x, (x-2, x-3)))   
   >>                                   
    Â Â Â Â Â Â Â Â Â Â Â  for x in range(-10,10) ) )   
   >>   
   >>   
   >>   
   >> is this easy in Scheme(Gauche) ?   
   >   
   >   
   > if the   Min()   is going to check all of the Candidate values,   
   >      it could (at least) tell us  how many times the Min value was seen!   
      
   I decided to add something like this to TXR Lisp.   
      
   It will appear in 296.   
      
   This is the TXR Lisp interactive listener of TXR 295.   
   Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.   
   When transferring between containers, do not siphon TXR by mouth.   
   1> (find-mins -10..11 : [callf * pppred ppred])   
   (2 3)   
   2> (find-mins (vec-seq -10..11) : [callf * pppred ppred])   
   #(2 3)   
   3> (find-mins "abracadabra")   
   "aaaaa"   
   4> (find-maxes "abracacabra")   
   "rr"   
      
   I works with any less-like function, assuming equality   
   when it’s neither true that x is less than y, nor that   
   y is less than x.   
   --   
   TXR Programming Language: http://nongnu.org/txr   
   Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal   
   Mastodon: @Kazinator@mstdn.ca   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca