<ox1eef>
cool +1. i also want to add, Object.create(nil, SomeMod) as well as a block.
<ox1eef>
to keep it close to JS, i think you should consider having a #prototype method, so.. obj.create(...).prototype.prototype.prototype etc should work. then, hasOwnProperty should have an equivalent as well.
<ox1eef>
delete(obj[foo]) should have an equivalent.
Guest65 has joined #ruby
seifeslimene has quit [Ping timeout: 256 seconds]
<mooff>
that Prototype#prototype might read ancestors.find { |m| m != self and m.is_a? Prototype }
<ox1eef>
could be, honestly i'm not sure. i think a linked list implementation is going to be what will work best, there's a few things which should work to be similar to JS. Object.create(nil) basically creates an openstruct-like object in my case.
<mooff>
ah, i see!
<mooff>
you've basically ported JS's Object :)
<ox1eef>
i tried to get as close as i could
Rounin has quit [Ping timeout: 272 seconds]
<mooff>
i read your ObjectMixin, thought of modules and was off to the races
<ox1eef>
:)
<mooff>
neat
<mooff>
i think the deletion behaves differently to JS
MaXxer0 has joined #ruby
comet23 has quit [Quit: Client closed]
MaXxer00 has quit [Ping timeout: 240 seconds]
<mooff>
whereas delete o['foo'] in JS will let o.foo traverse again, deletion cascades with your lib
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
gr33n7007h has quit [Ping timeout: 268 seconds]
gr33n7007h has joined #ruby
<ox1eef>
that would be something to fix then, the hope is to be as close to JS as possible
<ox1eef>
mooff: do you have an example case of that to try out?
<ox1eef>
ah indeed, i see it, thanks!
<mooff>
cool :)
Guest65 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John_Ivan has quit [Ping timeout: 272 seconds]
eldritch_ is now known as eldritch
ur5us_ has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
Guest65 has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
reset has quit [Quit: reset]
hololeap has quit [Ping timeout: 240 seconds]
hololeap has joined #ruby
FetidToot9 has joined #ruby
MaXxer0 has quit [Quit: Leaving]
FetidToot has quit [Ping timeout: 252 seconds]
FetidToot has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
FetidToot9 has quit [Ping timeout: 240 seconds]
Guest65 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest65 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<isene>
Trying to display a number in 'engineering notation' where the exponent is always a multiple of 3 (e.g. 26054 => 26.054e03). Did not find how to accomplish this even after extensive Googling. Anyone?
o|||||o has quit [Ping timeout: 268 seconds]
polishdub has quit [Quit: leaving]
teclator has joined #ruby
roadie has joined #ruby
___nick___ has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
Rounin has joined #ruby
jhass[m] has quit [Quit: Bridge terminating on SIGTERM]
sixecho has quit [Quit: Bridge terminating on SIGTERM]
hsiktas[m] has quit [Quit: Bridge terminating on SIGTERM]
hideki0[m] has quit [Quit: Bridge terminating on SIGTERM]
kinduff has quit [Quit: Bridge terminating on SIGTERM]
DenKn has quit [Quit: Bridge terminating on SIGTERM]
slact[m] has quit [Quit: Bridge terminating on SIGTERM]
artemon has quit [Quit: Bridge terminating on SIGTERM]
andrea[m] has quit [Quit: Bridge terminating on SIGTERM]
akochi[m] has quit [Quit: Bridge terminating on SIGTERM]
coolshaurya has quit [Quit: Bridge terminating on SIGTERM]
hideki0[m] has joined #ruby
jhass[m] has joined #ruby
hsiktas[m] has joined #ruby
coolshaurya has joined #ruby
sixecho has joined #ruby
kinduff has joined #ruby
DenKn has joined #ruby
andrea[m] has joined #ruby
slact[m] has joined #ruby
artemon has joined #ruby
akochi[m] has joined #ruby
libsys has quit [Remote host closed the connection]
libsys has joined #ruby
infinityfye has joined #ruby
libsys has quit [Remote host closed the connection]
ruby[bot1 has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
oxfuxxx has joined #ruby
some14u has joined #ruby
wks has left #ruby [Konversation terminated!]
some14u has quit [Ping timeout: 260 seconds]
some14u has joined #ruby
Furai has quit [Remote host closed the connection]
Furai has joined #ruby
some14u has quit [Ping timeout: 252 seconds]
some14u has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
some14u has quit [Ping timeout: 245 seconds]
infinity_fye has joined #ruby
infinityfye has quit [Killed (NickServ (GHOST command used by infinity_fye))]
infinity_fye is now known as infinityfye
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
markong has joined #ruby
nakilon has quit [Remote host closed the connection]
some14u has joined #ruby
oxfuxxx has quit [Ping timeout: 272 seconds]
some14u has quit [Ping timeout: 250 seconds]
<isene>
jhass[m]: That works for scientific notation - e.g. 26054 => 0.26054e5, what I need is => 26.054e03 (the exponent always turns out to be a multiple of 3)
<isene>
I could write a whole thing on this myself, but wondered if there is some canned solution for this somewhere
<jhass[m]>
maybe as a gem
<jhass[m]>
floating point printing algo's are actually quite the science in themselves..
some14u has joined #ruby
<jhass[m]>
(FWIW BigDecimal#to_s does call it engineering notation :D)
<isene>
Reason I need this is for my project "XRPN" - a new programming language (written in Ruby) that is a superset of the FOCAL/RPN language of the venrable HP-41 programmable calculator. It's similar to FORTH in that it is stack based. So far I have implemented the whole 250+ function set as well as a host of modern features (read/write files, read web pages, code injection/deletion for self-modifying
<isene>
programs, indirect addressing). It is also extensible like LISP in that any function can be upgraded while a program is running and new functions can be added on the fly. Github soon.
John_Ivan has joined #ruby
<isene>
jhass[m]: Yes, they call it engineering notation - but as a math/calculator enthusiast since forever, I know that to be an error :-)
oxfuxxx has joined #ruby
<isene>
It's not even a true scientific notation, as that would be => 2.6054e04
<jhass[m]>
There's also %e for sprintf/String#%, but that seems to be fixed at one significant digit
<isene>
Thanks for the catch. Seems I'm heading for a gem creation :-)
sixecho has quit [Quit: User was banned]
hsiktas[m] has quit [Quit: User was banned]
jhass[m] has quit [Quit: User was banned]
andrea[m] has quit [Quit: User was banned]
DenKn has quit [Quit: User was banned]
hideki0[m] has quit [Quit: User was banned]
kinduff has quit [Quit: User was banned]
artemon has quit [Quit: User was banned]
coolshaurya has quit [Quit: User was banned]
slact[m] has quit [Quit: User was banned]
akochi[m] has quit [Quit: User was banned]
ua_ has quit [Ping timeout: 256 seconds]
ua_ has joined #ruby
d-s has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
d-s has quit [Read error: Connection reset by peer]
d-s has joined #ruby
d-s has quit [Read error: Connection reset by peer]
d-s has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
ivanf has quit [Ping timeout: 246 seconds]
some14u has quit [Client Quit]
ivanf has joined #ruby
some14u has joined #ruby
gproto23 has quit [Read error: Connection reset by peer]
<mooff>
yay new code :-)
foxxx0 has quit [Quit: foxxx0]
foxxx0 has joined #ruby
acosta4 has joined #ruby
acosta has quit [Read error: Connection reset by peer]
acosta4 is now known as acosta
oxfuxxx has quit [Ping timeout: 260 seconds]
oxfuxxx has joined #ruby
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
favadi has joined #ruby
hideki0[m] has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jhass[m] has joined #ruby
hsiktas[m] has joined #ruby
DenKn has joined #ruby
sixecho has joined #ruby
coolshaurya has joined #ruby
slact[m] has joined #ruby
artemon has joined #ruby
kinduff has joined #ruby
andrea[m] has joined #ruby
akochi[m] has joined #ruby
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
rawley has joined #ruby
rawley has quit [Remote host closed the connection]
<isene>
mooff: Just wait till I release XRPN. Lots of new code (very algorithm heavy)
Guest48 has joined #ruby
oxfuxxx has quit [Ping timeout: 245 seconds]
oxfuxxx has joined #ruby
Tempesta has quit [Ping timeout: 265 seconds]
oxfuxxx has quit [Read error: Connection reset by peer]
justOkay has quit [Remote host closed the connection]
justOkay has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
o|||||o has joined #ruby
infinity_fye has joined #ruby
infinity_fye has quit [Client Quit]
infinityfye has quit [Ping timeout: 260 seconds]
reset has joined #ruby
cahoots has joined #ruby
<cahoots>
hi, i want to get the time that a function took, and Time.now is unsuitable for this due to NTP synchronization. how can i get a relative time?