beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
cpli has quit [*.net *.split]
casaca has quit [*.net *.split]
Abhishek_ has quit [*.net *.split]
abu[7] has quit [*.net *.split]
user3456 has quit [K-Lined]
teddydd has quit [*.net *.split]
Abhishek_ has joined #picolisp
casaca has joined #picolisp
user3456 has joined #picolisp
cpli has joined #picolisp
teddydd has joined #picolisp
seninha has quit [Quit: Leaving]
isaneran has joined #picolisp
isaneran has quit [Remote host closed the connection]
razzy has joined #picolisp
abu[7] has joined #picolisp
isaneran has joined #picolisp
isaneran has left #picolisp [#picolisp]
isaneran has joined #picolisp
razzy has quit [Quit: leaving]
isaneran has left #picolisp [#picolisp]
isaneran has joined #picolisp
rob_w has joined #picolisp
isaneran has quit [Remote host closed the connection]
isaneran has joined #picolisp
<abu[7]> k
lagash has quit [Ping timeout: 260 seconds]
Riffer has joined #picolisp
lagash has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
clacke has quit [Remote host closed the connection]
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
rob_w has quit [Quit: Leaving]
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
seninha has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
Riffer is now known as programming_stup
programming_stup is now known as Riffer
isaneran has quit [Ping timeout: 260 seconds]
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
isaneran has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
seninha has quit [Ping timeout: 260 seconds]
Riffer has quit [Remote host closed the connection]
msavoritias has joined #picolisp
dexen has joined #picolisp
<dexen> hello
<abu[7]> Hello dexen
<dexen> i want to read a bunch of floating point numbers from a text file, and some numbers are integers without the fractional part
<dexen> which seems to trip up the *Scl, how do i properly go about it?
<abu[7]> I would not use *Scl here
<abu[7]> Split the 'chop'ped line and use 'format' directly
<abu[7]> e.g. (format (car (split (chop Line) "\t')) 3)
<abu[7]> Well, of course you can use *Scl too
<abu[7]> ... (chop Line) "\t')) *Scl)
<dexen> the idiom is a doozy; i don't get why & how (split ... "\t") does the right thing with the decimal dot
<abu[7]> Just as an example, assuming the line is from a TAB separated CSV
<abu[7]> The decimal dot is handled by 'format'
<dexen> thanks now i get it. gonna yank the (split ... "\t") as the input is one number per line
<abu[7]> : (format "123.45" 4)
<abu[7]> -> 1234500
<abu[7]> ah, good
<abu[7]> I made it too complicated
<abu[7]> cause most of my use cases were such CSVs ;)
<dexen> now (format '("1" "." "5" "0") 3) does what i want, but (format '("1") 3) returns bare 1, rather than scaled to 1000, and that's my og problem
<dexen> some numbers in input are ints, and conditionally decorating them with with a trailing dot feels "wrong"
<abu[7]> Do you know which numbers?
<abu[7]> I mean, then just call (format '(...))
<abu[7]> But if they are all fixpoint, just some withot a dot, I think the best is to add one
<abu[7]> like +FixField does
<abu[7]> Line 1585 in @lib/form.l
<abu[7]> So "2" should read as 2000 ?
<abu[7]> i.e. *all* are fixpoints
<dexen> yes. the idea is to adjust the data a bit & pipe to gnuplot.
<abu[7]> I see
<abu[7]> So I think adding a "." is the easiest
<abu[7]> +FixField does the same
<abu[7]> it accepts "2" or "2." or "2.00" etc.
<abu[7]> Not really elegant. Is there a better way?
<abu[7]> it does (format (or (sub? *Sep0 S) (pack S *Sep0)) ...
<abu[7]> If you have a list of chars, it is (conc S (cons *Sep0))
<abu[7]> or simply (conc S '("."))
<dexen> oh yeah, my attempt at (match ...) was uhhhh http://pb1n.de/?492c1e
<abu[7]> that's ok but 'match' is very heavy
<abu[7]> (if (member "." S) (conc S "."))
<abu[7]> I just noticed (conc S '(".")) is not necessary
<abu[7]> (conc S ".") is good
<dexen> ty that helps a lot to get a *fee* for the language
<dexen> a feel*
<abu[7]> :)
<abu[7]> 'conc' is destructive, so it assumes 'S' is not used anywhere else
dexen has quit [Quit: Konversation terminated!]
<abu[7]> oops, just for the records: (if (member "." S) (conc S ".")) is wrong
<abu[7]> I meant:
<abu[7]> (format (if (member "." S) S (conc S ".")) 3)
isaneran has quit [Ping timeout: 272 seconds]
seninha has joined #picolisp
msavoritias has quit [Remote host closed the connection]
koka_lang has joined #picolisp
koka_lang has quit [Remote host closed the connection]
Riffer has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
lagash has quit [Remote host closed the connection]
lagash has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
Riffer has quit [Remote host closed the connection]
Riffer has joined #picolisp
Riffer has quit [Remote host closed the connection]