Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing data within bytes...
#9
Spaz Wrote:Lisp: where you have to modify the language to get anything useful done.

I don't really get what's going on here. You made a macro/function that lets you take the nth element of any sequence? Doesn't sound that special to me. :-\

Changing bits isn't hard if you write a function for it. In C++:
 Spoiler

Thing is, it's easier to refer to the bit through this, correct?
Code:
(un)signed whatever n = x;
int bitnumber = y;
cout << x[bitnumber];
x[bitnumber] = 1;

Dusk Wrote:I think you can in C *scratches head* In py/pl you can do something to the same purpose without writing a whole crapload of code. You wouldn't usually use Perl for the same things you'd want Lisp for anyway.

 whee

Oh, that's really fancy. I don't know what you'd use Perl especially for, though I know you guys have a Memoization module:

 Spoiler

If you're able to write modules which work like this, then it's amazing. In LISP, you could always make a macro which do the same thing:

 Spoiler

Though this would be rather slow for some cases (like where you can use an n-dimensional array instead), and possibly more inefficient unless you optimise the code some.


Kortestanov Wrote:If you just want a quick and simple way to xor every character in a string without doing too many convertions, just make a dll in asm and make an external dll call. This way you will also gain some performance, if that matters to you.

I suppose you could, and I suppose it wouldn't be too hard/ugly to implement something like that. But that's not really the idea behind this function. The idea was just to show lisp's flexibility, and hopefully something we would be able to do later on. I'm aware that changing bits (and bytes) in programming-languages doesn't occur extremely frequently, but since there's nothing to lose by having this function available, then why not implement it to ease the work for programmers?
Reply


Messages In This Thread
Changing data within bytes... - by Nikkey - 2009-07-17, 02:29 AM
Changing data within bytes... - by Fiel - 2009-07-17, 02:43 AM
Changing data within bytes... - by Nikkey - 2009-07-17, 03:03 AM
Changing data within bytes... - by AngelSL - 2009-07-17, 04:03 AM
Changing data within bytes... - by Nikkey - 2009-07-17, 04:43 AM
Changing data within bytes... - by Spaz - 2009-07-17, 04:11 PM
Changing data within bytes... - by Dusk - 2009-07-17, 04:35 PM
Changing data within bytes... - by Kortestanov - 2009-07-17, 05:20 PM
Changing data within bytes... - by Nikkey - 2009-07-17, 06:51 PM
Changing data within bytes... - by Spaz - 2009-07-17, 07:36 PM
Changing data within bytes... - by Fiel - 2009-07-17, 07:42 PM
Changing data within bytes... - by Nikkey - 2009-07-17, 08:37 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)