Euphoria Ticket #459: More peek/poke commands built-in

These two methods were asked about on IRC:

public procedure poke_double(atom ptr, object data) 
	if atom(data) then 
		poke(ptr,atom_to_float64(data)) 
	else 
		for i = 1 to length(data) do 
			poke(ptr+8*(i-1),atom_to_float64(data[i])) 
		end for 
	end if 
end procedure 
 
public function peek_double(object pDouble) 
	sequence bytes, doubles 
	atom double 
	 
	if atom(pDouble) then 
		return float64_to_atom(peek({pDouble,8})) 
	else 
		doubles = {} 
		 
		for i = 1 to pDouble[2] do 
			doubles &= float64_to_atom(peek({pDouble[1]+8*(i-1),8})) 
		end for 
		 
		return doubles 
	end if 
end function 

Discussion led to thinking it would be best to have these as internal plus peek8/poke8 and peek_pointer/poke_pointer

Details

Type: Feature Request Severity: Normal Category: Library Routine
Assigned To: mattlewis Status: Accepted Reported Release: 4.0.0.RC1
Fixed in SVN #: View VCS: none Milestone: 4.1.0

1. Comment by mattlewis Jan 02, 2011

See: hg:euphoria/rev/e94c2800cb26

changeset: 4459:e94c2800cb26 parent: 4451:8c20998f71ef user: Matt Lewis date: Sun Jan 02 08:45:03 2011 -0500 files: source/be_execute.c source/compile.e source/emit.e source/execute.h source/keylist.e source/opnames.e source/opnames.h source/redef.h source/reswords.e source/reswords.h source/shift.e tests/t_memory.e description:

  • poke8 / peek8s / peek8u implemented
  • applies to ticket 459

2. Comment by mattlewis Jan 03, 2011

See: hg:euphoria/rev/18433062621c

changeset: 4475:18433062621c user: Matt Lewis date: Mon Jan 03 14:22:44 2011 -0500 files: source/be_execute.c source/compile.e source/emit.e source/execute.e source/keylist.e source/opnames.e source/opnames.h source/redef.h source/reswords.e source/reswords.h source/shift.e tests/t_memory.e description:

  • poke_pointer peek_pointer
  • part of ticket 459

3. Comment by mattlewis Jan 03, 2011

See: hg:euphoria/rev/6c41c5278888

changeset: 4477:6c41c5278888 tag: tip user: Matt Lewis date: Mon Jan 03 15:34:41 2011 -0500 files: include/std/memory.e description:

  • docs for peek/poke_pointer
  • more implementation for ticket 459

4. Comment by SDPringle Dec 22, 2011

Just to be complete, can we have peek_long_double, peek_eudouble, peek_bits and the pokes for each?

Search



Quick Links

User menu

Not signed in.

Misc Menu